As a part of my involvement with GSoC 2010 project, I have been working with my mentor Pawel Solyga on "CCV-Custom Object Tracker". The project is not fully complete yet and has a lot of work/integration to do, but the object tracking part is completed so we are launching a preview release to get feedback from the community.

CCV-COT or CCV Custom Object Tracker is the modified CCV to do the object tracking. This post assumes that you have a basic understanding of CCV, read Getting Started with CCV as I will be explaining only the difference CCV-COT has from the main branch of CCV. Make sure to download the latest preview release and let us know any thoughts or ideas.

GUI Changes
(Click to zoom)

This diagram only mentions the difference it has from CCV 1.3, For a complete description refer to the CCV Overview Diagram

Configuration & Calibration
The configuration of this is pretty much similar to the Configuration of CCV 1.3. While configuring for fingers switch on the Finger Tracking, to be able to see id/outlines of fingers detected. There are some changes in the XML structure in config.xml, which end users need not worry about.

1) Use camera button [1] in the screenshot above to use the video camera.
2) The Calibration is same as the CCV Calibration Tutorial
3) First configure your CCV to track finger blobs and later we will do the configuration for objects tracking.
4) Change the settings in config.xml file which you can learn how to do on the CCV Wiki Tutorial.

Till now is what mostly same as in CCV 1.3. Which leads us to the next steps which you can find below.

Getting Started With Object Tracking
Check that "template.xml" is present. Which is empty (if you have no template saved), or has template data in the following format.


In case you want to assign a particular ID to this blob, change the "TRUEID" tag to 1 and "ID" tag to the particular ID you want to give this template. Say in the previous example, it would look like


If you want to clear all templates, you have to delete all the lines from "template.xml" manually. For adding a new template, make sure that tracking "Objects" in "Track" panel is on. Put the object which you want to track on the surface. You should be able to see a binary image on the "Tracked" image panel (Right big one). Draw an rectangle with mouse drag from upper-left corner to bottom-right corner , surrounding the object (The red rectangle in the image). Be as close as possible. Then adjust the "Template Area" panel's minimum Area and maximum Area sliders to select the maximum and minimum variation of the contour (blue and green rectangle respectively).

Then press "Enter" to add the template. Check the video for more details -

If you want to change the ID of a template while running, then first Add the template using the previous instructions. Save Templates. Open the templates.xml file. Change the ID to the wanted ID number and TRUEID to 1 for the template. And then Load Templates.

Make sure that your ID is in accordance of rules below, this allows for tracking of a mixture of objects with ranges for each group fids/fingers/objects

ID Assignment Rules

Code Changes
- Moved to OpenFrameworks 0.61 precompiled library instead of source.
- A new module in the sourcecode named "Templates" in ofxNCore.
- A very simple tracking process now, which will be changed in next releases.
- Modularized tracking of fingers/objects/fiducials.
- Calculation time minimized, in finger tracking by removing extra calculation.

Camera/Video toggle - Instead of having 2 buttons one button controls it. And yes, the crash on multiple switching between camera and video is fixed. Template Area Panel - The use will be described later in this post. This may change according to the algorithm used. Track Panel - Now you have a panel to choose what you want to track. Whether finger/objects/fiducial. Fiducial tracking is not yet integrated. Save/Load Template - These are two more buttons in the Settings Panel. As it says SAVE TEMPLATES saves template data stored, and LOAD TEMPLATES load the templates. The file used is "templates.xml".

Coming Soon
- Fiducial Integration.
- Better Tracking Algorithm (The current one is very very crude).
- CCV Debug Logging Mode (As logging is currently disabled).

Join the Discussion  |   Getting Started  |   Download Now  |   Get the Source