Blob-Detection with IR

Hi Guys,

since i was using Processing and JMyron or Blob-Detection Library for detection Blobs in a Scene which is irradiated with Infrared Light and recorded with a IR-Camera. Now i wanna do the same using Openframeworks.
So i watched the videoGrabber but i couldn’t find out how to detect Blobs or if there is a library for that?

Best,
Scrow

take a look at the opencv example, that comes with the FAT package. it demos the opencv addon which identifies blobs.

have fun!

  • zach

thanks, i did that. now i have it working, but i would like to get the coordinates from the found blobs? where is a full documentation about this library?

As far as I know, there isn’t full documentation for this library yet, however, you can get the blob information from the ofxCvContourFinder class:

Assuming that you are using the same object names as the OpenCV example:

  
  
int numBlobs = contourFinder.findContours(grayDiff, 20, (340*240)/3, 10, true);  
  

will return the current number of blobs.

Then you can call the following to return the information for one of the blobs

  
  
ofxCvBlob blobname = contourFinder.getBlob(blobnumber);  
  

The returned blob contains the following data:

blobname.area (blob area)
blobname.length (length of the blob)
ofRectangle blobname.boundingRect (the bounding rectangle of the blob)
ofPoint blobname.centroid; (the centre of the blob)

blobname.pts is a vector that contains ofPoints for all of the points of the contour
and blobname.nPts is an int that is the number of points in the contour

Hope this helps and I haven’t given you any false info :stuck_out_tongue:

Theres links to a list of datatypes and functions etc here
http://opencvlibrary.sourceforge.net

Its not exactly walkthrough / tutorial material, but at least you can see what functions there are and how to call them!

On a side note, dunno if this suits you, but alternatively you could use something like reactivision (cross platform) or touchlib (pc only) to do your blobtracking and then communicate the data via OSC ( TUIO) to your openframeworks app, and just use the reactivision TUIO library to receive the data and do whatever you want to do. (I actually haven’t used the TUIO lib in openframeworks yet, but have used it in processing and its really nice!)

great! Thanks a lot.
Now i start blobbing!

BBtouch by Ben Britten is also available on os x 10.5 he has just given the world TUIO! Hail to the new King! http://benbritten.com/blog/2008/07/22/t-…-t-is-here/ :shock:

sorry, i did not quiet understand this part:

_blobname.pts is a vector that contains ofPoints for all of the points of the contour
and blobname.nPts is an int that is the number of points in the contour _

where is the vector to be found with all the coordinates?

sorry again, i meant, how can I use the points further?
How can I printf(); them
How do I declare a vector varibale?

this is the part of the code, where i wanted to print ist out (from teh example)

  
  
 for (int i = 0; i < contourFinder.nBlobs; i++){  
		  
		// Koordinaten von Konturen  
		float x=contourFinder.blobs[i].centroid.x;   
		float y=contourFinder.blobs[i].centroid.y;  
		  
//		contourFinder.blobs[i].pts; ????  
  
		  
        contourFinder.blobs[i].draw(360,540);  
    }  
  
  

this is off the top of my head, but is this what you mean?

  
  
 for (int i = 0; i < contourFinder.nBlobs; i++){  
        
      // Koordinaten von Konturen  
      float x=contourFinder.blobs[i].centroid.x;  
      float y=contourFinder.blobs[i].centroid.y;  
      int nPts = contourFinder.blobs[i].nPts;  
      for (int j = 0; j < nPts; j++){  
      	 float xPt = contourFinder.blobs[i].pts[j].x;  
      	 float yPt = contourFinder.blobs[i].pts[j].y;  
      	 printf("point %i of blob %i = (%f, %f) \n", j, i, xPt, yPt);  
      }  
      contourFinder.blobs[i].draw(360,540);  
}   
  

take care!
zach

thanks a lot, zach!
I really appreciate your work and your efforts in this forum!

now i have the coordinates of the outline, how can i possibly map things on this area? The purpose is, to use this outlines / conturs as border and not the bounding box.