Vermes
Advanced Member level 4
Assumptions:
The program should be able to find and track two markers using a webcam. In addition, the program should list the basic data on found objects: colour (RGB), coordinates X and Y, the angle of inclination relative to each other, etc.
Achievements:
The basis assumptions were implemented, camera handling code was taken from free source from LINK.
Application was written in Microsoft Visual Basic 2005 Express Edition and checked on computers with Windows XP. For the proper work it requires installed .NET Framework software in version 2.0 or newer. To run the application, click on the shortcut called „seeker.lnk”.
Description of the program's window:
- after starting the application, information about the camera driver appears in this textbox
- while the program is working, information about the markers and the environment is displayed
- at the beginning, before you click the START button, you can improve the detectability of the markers using the slider – just select experimentally at different lighting conditions (the best results were obtained at the values from -20 to 10)
- buttons: START – activates the camera and starts searching for the markers; RESET – searches for the markers from the beginning, RESTART – the application starts again with default options
The program performs a screenshot of the window, cuts the PictureBox1 frame with the frame of the camera image and saves it in a variable, which is then loaded into the control PictureBox2 (right image). In this way you have the camera image in the frame PictureBox2, on which you can perform the necessary operations.
Blinking black elements on the screen, that were useful when working on the application, were left to be visible, so you can track the progress of the program during operation. The best results were under artificial light, where the environment has warm colours (the lowest component is blue) and the overall brightness of the room is moderate. During tests, the slider (3) should be used to set the appropriate value so that at the first searching pass it finds one of the points. If none of the markers is detected for the first time, press the RESTART button and set a different value. Please note that the size of the squares around the found points (squares show up when the markers disappear from view). The larger the square, the better.
The program responds to the blue colour, the best is to stick to circles on a sheet of A4 and make tests. The program begins to track only when it finds two objects.
Link to original thread (useful attachment) – Program śledzący punkty