I’ve made a little app that will track coloured objects in video. It’s really my first stab at both openFrameworks and C++ so it’s very much a work in progress.
You can see a windows screen-shot here:
And if you want to have a play I’ve uploaded a zip with a mac binary in it. I’ve also included the SRC folder for you to take a look at the source. This was based on the movieGrabberExample app that comes with OF so if you make a copy of that and replace the src folder with this one it should build.
The binary was compiled with XCode 2.4.1 on a Macbook. OF 0.02
The keys are as follows:
Press any number between 1 and 9 on your keyboard
Hold either a Red, Green or Blue object up in front of the camera and position it within the square in the centre.
Press C. It should now start tracking the object as you move it around the screen.
Repeat these steps for each object you want to track. Realistically it’s limited to three, one Green, one Red and one Blue because it will confuse objects of the same colour.
P Turns on a pen so it leaves a trail
Q Clears this trail
U Increase the search area
D decrease the search area
F Flip the screen to make it more mirror like.
This is really my first proper stab at C++ and I’ve got tonnes more to learn so I’d love to hear any feedback or suggestions about other things I could try or how I could improve it. I’m a bit lost for potential applications for this because it was largely just to try and develop my C++ skills and have a go at tracking objects. Any suggestions for potential directions to take this in would be much appreciated.
Thanks again for OF guys it made it so much easier starting out coding.