cv.jit.faces replacing box with image

    Jul 05 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.

    • Jul 05 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.
    • Jul 05 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.
    • Oct 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"..?)
    • Oct 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?
    • Oct 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..?
    • Oct 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.
    • Oct 28 2010 | 11:37 am
      please do so! any further help appreciated..
    • Oct 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.
    • Nov 02 2010 | 10:31 am
      is there a way to use [cv.jit.blobs.sort] in combination with [cv.jit.faces]?
      all the best
    • Nov 03 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!
    • Feb 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
    • Apr 30 2015 | 6:42 pm
      There's a brand new build for Mac and Windows that’s 64-bit compatible and tested on Max 7!
      Download the cv.jit Starter Kit at
      Leave a comment and let us know how it's working for you!
      Happy patching!