Forums > Jitter

cv.jit.faces replacing box with image

July 5, 2010 | 11:00 am


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.

July 5, 2010 | 1:17 pm


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. –
July 5, 2010 | 1:42 pm

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.

October 19, 2010 | 11:18 am


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



October 25, 2010 | 9:14 am

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?



– Pasted Max Patch, click to expand. –
October 27, 2010 | 5:19 pm

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..?



– Pasted Max Patch, click to expand. –
October 27, 2010 | 9:35 pm

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.

October 28, 2010 | 11:37 am

please do so! any further help appreciated..



October 30, 2010 | 2:15 am

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

November 2, 2010 | 10:31 am


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

all the best


November 3, 2010 | 11:39 am

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

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!



February 10, 2011 | 2:12 am


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


– Pasted Max Patch, click to expand. –
Viewing 12 posts - 1 through 12 (of 12 total)

Forums > Jitter