Hiya,
That’s my first message here - I’m really seduced by openFrameworks but I’m still struggling a lot with it, I’m coming from actionscript / processing, and I didn’t know anything of C++ until last week.
Also, please excuse my english that can sometimes sucks.
I’m trying to use the method haarFinder of the openCV addon, which works great, but in all of the examples that I’ve seen so far, you can only extract the regions that match as ofRect instances.
How would I proceed to draw in a texture the shape of a head ? I’ve seen you can extract blobs with openCV, but I didn’t manage to get anything to work.
There’s on vimeo & youtube videos of installations made with oF that extracts heads as non-rectangular shapes, so I guess this is possible (such as this one : http://www.lalalab.org/drupal/index.php-…-my/term/32)… Any help would be greatly appreciated.
I can’t look at the video you linked and answer quickly but you could look at 2 functions in openCV:
cvMinEnclosingCircle()
and
cvFitEllipse2()
Searching the minimal contour enclosing Circle or Ellipse
Thanks a lot for your answers. Actually I did it in a different way, thanks to some topics I found on the forum.
First, I load a grayscale mask picture (basically an ellipse with a gaussian blur), that I resize to the ROI dimensions.
I then loop through the pixels of the videoGrabber image, copy just the ROI portion (as explained here) and then set the alpha pixels to match the mask one (as explained here).
If you’re willing to deal with a little latency, you could try smoothing out the rectangle center and size over time (which would help avoid the jumping around).
Also, detecting the eyes and then using that for determining the width rather than the rectangle might be more accurate (especially in near-portrait cases).