hi all,

I will post more info about this code, but this project is made in OF (0.02), and the source code is online.

I hope you enjoy it:


future versions will include some instruction manuals / etc, but in the meantime, I thought I would throw up the code – there are some nice parts I will rip out and post individually, including a fairly robust finger tracker system that works with the opencv addon contour finder.

take care!!

Very interresting especiallly the finger tracking part.
Maybe you could create another samll finger tracking example for the opencv addon.


hi zach,
and wise OF hackers,

I am trying to get your example to run on a mac. I started with an older OpenCV projecct. After adding all the files from opensourcery and adding the new draw(float x, float y, float _w, float _h) method to ofCvGrayscaleImage I am still getting the following error:

/Users/noema/Development/svn/openFrameworks/app/opensourcery/src/tricks/imageRecallTrick.cpp:95: error: no matching function for call to ‘ofCvGrayscaleImage::draw(ofCvBlob&, int)’

This refers to this code

for (int i = 0; i < nBlobs; i++){  
    mask.draw(vbd->contourFinder.blobs[i], 255);  

Seems like I am missing another draw method.
Any ideas where I can get this one,

my bad —
I´m sorry for the confusion

I made the mistake of thinking that I hadn´t modified OF (this is a very common mistake, understandably as people hack it out to do what they want with it). I will post the modification shortly, once I get my laptop online.

Then theo and I will make a definiteive guide about extending OF classes, so that it´s easier to get the code up and running for others, and Ill post a clean 0.02 compiling app.

thanks & sorry ! zach

… a side note on extending OF classes:
I have been doing this a lot lately but I ran into one problem. A lot of the member variables are defined as private. This means that they are not accessible from custom subclasses (e.g. members in ofImage or ofCvColorImage). Maybe those should be defined as protected instead so subclasses can access them.

hey - that’s a great point about protected vs. private, we will work that into the next version (and it should help greatly with extending)

this is the missing addition from the grayscale image class:

// in the h  
void  draw(ofCvBlob blob, int color);  
// in the cpp:  
void  ofCvGrayscaleImage::draw(ofCvBlob blob, int color){  
       if (blob.nPts > 0 ){  
               CvPoint * pts = new CvPoint[blob.nPts];  
               for (int i = 0; i < blob.nPts ; i++){  
                       pts[i].x = blob.pts[i].x;  
                       pts[i].y = blob.pts[i].y;  
               cvFillPoly( cvImage,&pts, &(blob.nPts),1,  
               delete pts;  

I think (hope) it’s the only OF change, but I will make a version that extends everything out and put it up.

this function draws a blob into an image, I think I use it to create masks for the snapshots of objects…