face detection as a trigger

nw's icon

hello,
I'm a student just starting with Jitter, and i desperately need some help.. I'm trying to use face detection to then trigger an effect (i.e distortion of users image, like data moshing or something similar), then when the user moves away from the camera the effect stops and returns to normal. It's probably incredibly simple but have been confused for a few days on getting the idea together, I have come across patches for both face detection and for creating numerous effects with live video but am having problems connecting the two - any help or advice would be great....

Thanks
Nick

Eli's icon

Check out the [cv.jit.faces] object for face detection/tracking. Here's a simple patch using it:

Max Patch
Copy patch and select New From Clipboard in Max.

In this example I use [jit.streak], but any effect could be used. The main idea is that [cv.jit.faces] is queried for the number of faces in an image and then that data is used to decide how much of/ if an effect is applied to the original image. Hope this helps!

Eli

nw's icon

Brilliant! Thank you so much for your help - this gets me started, and just what I was looking for. Perfect.

Nick.

stnick's icon

Sorry for bumping this but how do I run the patcher described above?

I want to do something similar. I would like to have Jitter render a black screen over a movieclip when there is no face detected but I have no idea how to achieve this with Max/msp/Jitter. However, it is the only software package that is able to run opencv on my cam.

stnick's icon

Hello, could someone please explain this to me?

stnick's icon

Please,someone?
I just want to see the example of above or be provided with a direction on how I can turn down the brightness of a movie clip when no face is detected.

MIB's icon
stnick's icon

The patcher does not seem to work (error 9505) but thank you so much for the link!

MIB's icon

works fine here. did you make sure you copied everything including ----------begin_max5_patcher---------- and -----------end_max5_patcher-----------

Zeesy's icon

New to Max. Just tried this patch on a trial version of Max 7, Macbook Pro with and Intel chip running Yosemite, but I'm not getting a video signal on the patch, just black boxes. Other face tracking patches I've tried also seem unable to access the camera. Anyone have any ideas what the problem might be?

SID's icon

Hi Zeesy,

Do the cv.jit.faces objects appear as the same colour as the jit.rgb2luma and jit.qt.grab objects? If not, you will need to download the cv.jit object collection.

I'm running the same system as you and the patch works fine, but I have the cv.jit collection.

Wil's icon

then install: harddrive>users>shared>Max7>Packages (just drop the whole folder in here)

Rob Ramirez's icon

the latest cv.jit library (updated for 64 bit and max 7) is found here, along with some instructional videos:
http://www.maxology.club/starter-kit-info/2015/4/27/starter-kit-1