cv.jit.faces replacing box with image

Jul 5, 2010 at 11:00am

cv.jit.faces replacing box with image

Hello,

I’m working on a simple installation that will recognize faces and replace them with an image. I’m planning on using cv.jit.faces for this.

I’m succeeding in doing this very well with one face. I’ve simply made my own version of cv.jit.faces.draw, and using the “drawpict” command for jit.lcd. That works great.

The problem is when multiple faces are recognized…rather than place the image where each face is (as cv.jit.faces.draw does by default with the drawrect), it seems to get confused and place the images in between the faces.

I’m imagining that this is because jit.lcd treats images differently than simple shapes, but I can’t figure out a solution!

Any help would be great, many thanks in advance.

#51223
Jul 5, 2010 at 1:17pm

Hi,

It’s not really clear from the documentation, but to get drawpict to draw as you would expect you have to format your message like this: drawpict . Since cv.jit.faces outputs left-top-right-bottom coordinates, you’re going to have to massage those numbers a bit, but it should work.

– Pasted Max Patch, click to expand. –
#183715
Jul 5, 2010 at 1:42pm

Merci Jean-Marc!

That works perfectly, it was definitely a problem with the drawpict command.

Thanks so much, and thanks for your amazing work on cv.jit.

#183716
Oct 19, 2010 at 11:18am

Hello!

Is there a way to allot different pictures to different faces? (So not everyone showing up has the same “face replacement”..?)

Cheers!

Jonas

#183717
Oct 25, 2010 at 9:14am

assuming one has colorbars.pict & colorbars2.pict for replacing two faces.. this might be a simple approach, but for now the “closest” I get (considering my grasp of logic).. apparently this doesn’t suit max at all.. where am I mistaking?

cheers!

-jonas

– Pasted Max Patch, click to expand. –
#183718
Oct 27, 2010 at 5:19pm

ok, I’ve come this far.. everybody’s got his own image as a “face replacement”..

the problem now is that the face appearing last in the camera’s view gets the first image. (imagining we only have 2 people looking into the camera, the second person being detected gets the first persons image, respectively image2 suddenly being alloted to the first person)

how can I make the images stick to their “partners”, prevent them from swapping..?

cheers!

-jonas

– Pasted Max Patch, click to expand. –
#183719
Oct 27, 2010 at 9:35pm

I have the same issue except I am not using faces but people silhouettes, so I’m using cv.jit.blob.centroid instead of cv.jit.faces.

will post a sketch once i have a sample of the video input I get.

#183720
Oct 28, 2010 at 11:37am

please do so! any further help appreciated..

best

-j

#183721
Oct 30, 2010 at 2:15am

Yeah, I think at some point you’ll have to use blobs and blob.sort to keep your tracked areas in the right order.

#183722
Nov 2, 2010 at 10:31am

so..

is there a way to use [cv.jit.blobs.sort] in combination with [cv.jit.faces]?

all the best

-jonas

#183723
Nov 3, 2010 at 11:39am

sorry to keep bringing this up. it’ll be my last go this week (:

I just saw that I’m not the only one looking for a sorting solution in [cv.jit.faces] (what a surprise), as these earlier posts show

http://cycling74.com/forums/topic.php?id=26467

http://cycling74.com/forums/topic.php?id=27273

at least I’m relatively sure to be on the right track when aiming for a [cv.jit.blobs.sort] suitable for [cv.jit.faces]

any (modification) hint appreciated!

best

-j

#183724
Feb 10, 2011 at 2:12am

Hey

So i have been able to layer an image over the face with the above patches, but how would you take a live camera to replace the box, rather then the image?

I am trying to use cv.jit.faces.draw to take the live feed since jit.lcd can’t take video (unless i’m mistaking)

any help would be great!

patch is below

thanks!

– Pasted Max Patch, click to expand. –
#183725

You must be logged in to reply to this topic.