Go to the home page

Super Sprinters : a flash racing game

News about the LapCounter software
LapCounter Downloads
LapCounter Documentation
LapCounter Source Code

Stuff about my race-tins
Stuff about my circuit

GeneRally Tracks download

Forums to discuss about the soft, RC, tracks, etc.

Links (RC minis)


2004 © Ouais




LapCounter Docs



05/07/04
Version 0.11 beta

Tips
Here are tips to improve detection efficiency.

22/02/04
Version 0.1 beta

LapCounter Features, User guide & How it works.

The user guide is simple but it helps you in using the software.
It is divided in 4 parts:


How it works. Explanations can be found at the bottom.





Features


  • Full race management.
  • Sounds enabled.
  • Cheap solution: no need to buy a transponder or some sensors, only requires a webcam.
  • Flexible. Maybe be used with a wide range of RC cars.
  • Fuel consumption + pits stop management.
  • Customize sounds.

Coming soon:
  • Export to file.
  • Race events.




Race setup


    Firstly, you must setup the race, so click the setup race button.





    Numbers of cars to race.





    Numbers of laps in the race.





    Cars position to start the race.
    Input:
    The cars will be positioned in the same order their infos are input into the software.
    Random:
    The cars will be positioned in the a random order.
    Qualifs:
    A qualification run will be done before the race. The cars will be positioned according to the qualification results.






    Fuel consumption
    This feature enables you to simulate fuel consumption.
    Cars will consume some amount of fuel during the race and must stop at pits to refill.






    Fuel consumption settings.
    Decrement value.
    Specify the way the fuel consumption will be calculated.
    Lap - Fixed
    All the cars will consume the same amount of fuel during a lap.
    Lap - Random
    The amount of fuel consumed by the car will be calculated randomly at every lap, for each car.
    Time - Fixed - not available for now
    All the cars will consume the same amount of fuel during a time period.
    Time - Random - not available for now
    The amount of fuel consumed by the car will be calculated randomly at every time period, for each car.






    Numbers of laps done with a full tank. - when Lap - fixed is selected.
    This is a fixed value. It is used for each car. When Lap - random is selected, 2 values must be set:
    The number of laps that can be done with a full tank,
    The maximum variation in percent.
    The random amount of fuel consumed will be calculated from these values.





    Fuel filling settings.
    Increment value.
    Specify the way the tank fill up delay will be calculated.
    Fixed
    The delay is fixed, and will be the same for each car.
    It depends on the fuel quantity left in the car tank.
    Random
    The delay will vary between a minimum and a maximum thresholds.
    It will be randomly calculated at every car fill up.





    Number of seconds to fill the tank. - when Fixed is selected.
    This is a fixed value. It represents the number of seconds needed to fill completely the cars tank if it was empty.
    When Random is selected, 2 values must be set:
    Minimum & maximum delays (in seconds) to fill an empty tank.
    It will be randomly calculated at every car fill up.





    Video setup.
    Place the camera and set the focus.
    Press Ok when ready.





    Confirm if it's ok.





Cars setup


    Click Setup cars to set up the cars infos.





    Car number.





    Car name. Brand, model, whatever you want.





    Driver name.





    Video Setup. Place the car inside the field of the webcam and press ok.





    Idem with the second car.
    As an example, this is its picture.





    Color selection.
    You must select a color to represent each car.
    The color must be unique and not appear on other cars.






    Color selection on our examples. I used plain colored stickers to identify cars color.






    User verification.
    Check if the color selected is ok for you.





    Color verification.
    The software will analyze pictures to check if colors are unique and don't appear on other cars pictures or in the background startlane picture.
    In this example, red was chosen for the second car (Suzuki Jimmy) and appears on the first car (Skyline). The software has detected a conflict.
    The user must choose other colors, for example, yellow for the second car.





Qualifs


    In this section, we'll see how to set up and run qualifs.

    Number of qualification laps.





    Call of the next car.
    Time starts when clicking on ok.





    Car #1 in qualification phase.





    Qualification phase for Car #1 is finnished.





    Qualification phase is finnished for all cars. Results are displayed.





Race


    Start lights.
    Used to prepare drivers for the start.





    During the race.
    Infos are displayed for each car.
    Cars list is ordered according to their race position calculated at the checkpoint.
    So every time a car passes by in the camera field, its laps number is incremented.
    If playing with fuel consumption, the amount of fuel in the car tank is decremented.





    At pit stops.
    When stopping for a certain time (set in the progs setup) in the camera field, the car is considered at the pits.
    A pop-up window appears to show the time left to fill the tank, along with some infos concerning the car. The car stops filling up its tank either when it leaves the pits, or when the tank is full, when the time is equal to 0.





    The car #1 has finished and won the race.
    Other cars still race until they reach the number of laps for the race.






How it works




    System setup.
    The best camera position is when pointing to the startlane from above.
    For 2 reasons:
    1) No background interfering.
    2) If 2 or more cars pass by at the same time, they can't hide each other if point from above.





    A picture of each car much be taken.





    So that a color can be associated with each of them.
    The color is used to identify the car. So it must be unique.





    During the race, the software will analyze each picture taken by the camera in order to detect selected colors.
    If a color identifying a given car is detected in the picture, the software considers that the car is passing through the checkpoint.





    When analyzing pictures, the software tries to detect each color.
    In that 2 or more cars can pass through the checkpoint at the same time.





    As the software analyzes severals frames per second, it must take care not to consider that a car passes through the checkpoint every time it detects its associated color.





    Before starting the race, the software processes a color verification to check if a selected color appears on other cars pictures.
    Without this verification, a car containing another car associated color would enable a checkpoint for the later.







Tips to improve detection




Current problems:
Cameras auto-balancing change colors. Detection is affected.
Noise on frames also affects detection.
Cars are colorful, it's quite hard to find enough different colors to identify cars.

The solution for now is to optimize the current use of the prog, without reprogramming it totally: We'll hide cars with plain (white for example) masks and identify them with a colored flag, fixed to the antenna.



Installation:
  • 1) Place the webcam on the same plane as the track (floor for exemple), or a few centimeters higher). Orient it towards the track.
  • 2) Place a big mask on the opposite border of the track. In order to have a plain background (white cardboard for exemple).
  • 3) Place a smaller mask (white cardboard or band of paper for example) on the border (side where the camera is placed). In order to hide cars.
  • 4) Stick a colored paper (flag) on each antenna.
Only antennas are visible.



Images should now contain only:
  • white background
  • white foreground
  • colored flags
  • (noise)
You can setup the prog at startup in order to crop the video image if you place the camera too far and the masks are not large enough (to process only a part of the frame).

You can specify a higher tolerance value as a few colors will appear on the frames, in order to improve detection. Because of auto-balancing on cameras, color detection is harder. With a higher tolerance, it should be ok.

At the beginning, I avoided this solution, in that I didn't want that cars' flags may hide behind some others, when passing by at the same time (probability very low indeed). To solve this, a solution consists in placing flags at a different height on the antenna.

Java and win32 versions don't give the same performances, so detection may be affected. Since version 0.11 beta, you may specify different processing speed values for detection.