Archive

Archive for July, 2010

CCV-COT : Update

July 23, 2010 13 comments

In the past weeks, I have been working on my Last Post’s TO DO List, and this post is to update you with my work.

CCV Debug Mode :

As the CCV users may be knowing , CCV logging was removed in CCV 1.3. This was due to several users reporting a bug  that the logs become very big size(sometimes in GBs). Logs help developers to visualize a crash situation, so its quite an important part. Therefore I have tried a workaround for that. Instead of logging every time, we make the logging optional. This is called CCV Debugging mode. You just have to pass a command line argument -d for that e.g.

"Community Core Vision.exe" -d

And CCV Debugging mode is activated. Also , to make it simpler , in the next release a shortcut to CCV Debug mode will be included with the binaries. As usual this saves the Logs into the “logs” folder with the timestamp as the filename.

CCV Fiducial:

I know, this has been much awaited and many people have tried to do this before. Here is Stefan Schlupek’s repo where he managed to do it properly. I have integrated Fiducial support in CCV-COT.

Things TBD :

  • First of all , I have to test the Fiducial additions ASAP and do all the corrections.
  • Sending 2DObj messages for Objects (right now it is 2DCur) also for Fiducials.
  • The TUIO bug , that has been many reports of TUIO not working properly. Have to look into that.
  • Better Object Tracking algorithm (after all the integrations are done)

Release :

I am not releasing this time, as I have not tested them well. So in next few days, there will be changes going on. I will release them after testing it out. It must be soon though ! In case you are in a hurry to try it out , you can do it yourself by checking out the repository and compiling the code yourself. In case you run into any problems, just let me know via comments/mail.

Also for my previous version , slugmobile(noah) has compiled binaries for Mac OSX . In case you want to try them out, check here.

CCV-COT : Getting Started

July 6, 2010 6 comments

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

  1. 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.
  2. Template Area Panel – The use will be described later in this post. This may change according to the algorithm used.
  3. Track Panel – Now you have a panel to choose what you want to track. Whether finger/objects/fiducial. Fiducial tracking is not yet integrated.
  4. 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 [1] 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.

Process :

  • 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).
Follow

Get every new post delivered to your Inbox.