CCV-COT or CCV Custom Object Tracker is the modified CCV to do the object tracking. For a getting started guide to CCV, refer here : Getting Started with CCV . This post assumes that you have a basic understanding of CCV , as I will be explaining only the difference my work has.
DOWNLOAD : CCV-Custom Object Tracker
SOURCECODE : Googlecode SVN
Source-code Structure Changes :
- Moved to OpenFrameworks 0.61.Using 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, even in finger tracking by removing some extra calculation.
Changes in GUI :
This diagram only mentions the difference it has from CCV 1.3 . For a complete Description refer – http://wiki.nuigroup.com/Getting_Started_with_tbeta#Overview_Diagram
- 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”.
ID Assignment Rules :
Configuration & Calibration :
The configuration of this is pretty much similar to the configuration of CCV 1.3 : http://wiki.nuigroup.com/Getting_Started_with_tbeta#Configuration . 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.
The use camera button  in the figure, is used for camera and video also.
The Calibration is same as the calibration of CCV 1.3 : http://wiki.nuigroup.com/Getting_Started_with_tbeta#Calibration
You should first configure your CCV to track finger blobs and then you should do the calibration with finger blobs. The calibration can be done by the Object tracking also, but that would not be precise.
Changing the settings in config.xml file: http://wiki.nuigroup.com/Getting_Started_with_tbeta#Changing_Input_Resolution.2C_Frame_Rate.2C_Communication.2C_Video.2C_and_Blob_Settings
Till now is what mostly same as in CCV 1.3.
- Configure and Calibrate.
- Check that “template.xml” is present. Which is empty (if you have no template saved), or has template data in the following format.
<TEMPLATE> <WIDTH>36.000000</WIDTH> <HEIGHT>55.000000</HEIGHT> <MINWIDTH>25.520044</MINWIDTH> <MINHEIGHT>38.988960</MINHEIGHT> <MAXWIDTH>46.833553</MAXWIDTH> <MAXHEIGHT>71.551262</MAXHEIGHT> <<strong>TRUEID</strong>>0</<strong>TRUEID</strong>> <ID>180</ID> </TEMPLATE>
- 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
<TEMPLATE> <WIDTH>36.000000</WIDTH> <HEIGHT>55.000000</HEIGHT> <MINWIDTH>25.520044</MINWIDTH> <MINHEIGHT>38.988960</MINHEIGHT> <MAXWIDTH>46.833553</MAXWIDTH> <MAXHEIGHT>71.551262</MAXHEIGHT> <TRUEID>1</TRUEID> <ID>189</ID> </TEMPLATE>
- MAKE SURE THAT THE ID ASSIGNED IS ACCORDING TO THE RULES . Or else this will cause problems as object ID/Finger ID/ Fiducial ID will be confused.
- 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.
Coming Soon :
- Fiducial Integration.
- Better Tracking method (The current one is very very crude).
- CCV in Debug mode (As logging is not there).