face detection as a trigger
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….
Check out the [cv.jit.faces] object for face detection/tracking. Here’s a simple patch using it:
----------begin_max5_patcher---------- 1417.3oc2alsjahCEF9Z2OETtxkdnzJKyUYdNlJUJrQ1MIr3.3z8Lox69nEr McLfOlsPO4BaKEL7qON+Gcjv8OdZ05sYuJJVa8mV+s0pU+3oUqzco5XUU6Uq SBdcWbPg9vVmHJJBNHVuw7+UJdsT2O9bO6yRKKh9WgpWLwFU08yQgghTcmU8 DEp+hYa+xeP7O+sOFTt64nzCeNWrqznKpGWdVjmKr5MJwlKa3Yir9T02I8TR TZrnTKPx0NyNUdtWbMwkFjnE25+JOJH97E1bvk+yQg4ptd8ky+wbQgHsLnLJ Kstt7IFcwTugpdw5SpuzOe5I0KaFJTs4CBqdcgUNYYhUNxnKxjgUjs6fvJpK rh8+Mg0d.nTwKxAzM7INKHbaP5gg.IL+9PxW+pi9dLA0FiviEizCo9woSIaE 4MhCoE0mi8baHLgzEA78rYLLgyjgGN5Db7a4PYdTwtfX8UBY6CmNjGmNQokq 2LDH0laKLRMrklbqOfeTDRghPOOaOJkxje1wSa.Wpdt8wYxqLDPH0bTh7P02 7QMPGVWzg5aS8vXe9RI.SNvCFXH1HxttROQ7bzgPOH1jR870De4ZtXYYa10i 4Ya6gS0A.OqYRYKaSZavQeWuGzwEpSsFhppO6cVsCeIpztnLWD706T8P8ZE5 JQFgS09Oh1Fx48oXgd3vjiiOmDHM5uprY8CQJVb7knzvrWNecBEGKed6o86k kSnRdz.L5r5Rj12P7cMUWZRMw5INtMRXCjBzQl6A9S25d9.Vl0EgfGA005GI HcYlLjlYb16QWUbTpPRY3.wE.PHl2b51QQGKGU+8QsEl759fv9jMFC.Nb70z MuGyAqYC73kNKGpJMii15XlVp83ExRJCbaQNGDko6C1IJZhP9MVvXG.xrNVB 0DxnmtByWpgLuYorOqHxtr3rbyIEY64h3ddaZ7S3Zio6BL58MYU6rG0Xxb62 5R1d3s52Q9O2MM9I7aum7ad8xsXdykWIg0CFcx..aGcfoiyMvdZJfp+l1V.y tuaqRroAicXdvKfoCtyD9jZzwyua5LZl2ZI2Vf13Zqdtos1qKqMlapm.ieHq cs0Ny9eoausYhRxBEwsTCSyAyN.nO0rXI7xdpn1qdI+vVR7oj.3Tw8tV7psy Y1R.NVqfb+whCmhfShtdnOlmUEm5dci2ojE7TA8ZEzzNK8fVawfXmpm0zHu. 5oYROvg.T18muyrQBNj2Qlg1RgtKNqP.uToNqj2T7NRaSnK6J4aCGYGEovoQ WdEGbcZfVzznL6vg3Kvn9H79lgqKYqqAX2OGxFqXXLyDjHJyyrHvuyxu6310 85F.MC07N5KURkY7ak1GxC1p1KT0FgZ8wuqpnxhX8wSoQe6jvBdkULm6WCAs JgIeAj2Teo0aM3u7K3QKeU+uEoEYmx2c9De9mci00QPnnnLJUucu0NHU090N naen+IQgGyjQ6UhnkaviplTOZ84TSdPzDad0DBhl3yplvbHZxeApI0MX7BSS n4MdhBIWPaw3noQStKPM4r.0Dn3Im4USLHZxcd0DAhlnyplXSQ7DEq+YGxcM O2FxkVCMwEjap7VxkNM7CRnOF8X3iP7UDi3a1fDYYdmaMz.PLP98HhE6ojGy 07KCvSuXs21hXdn2mGVpVCbf.Iw7uLXm5.AH0MNuoafLip+xKYCeH4ZLgXiQ tFFnI05kVq10Kj2kVyRR74M5iAYxN1CVT.FYlKgXdvs3KMFpXoSfXcQSiV4S fVGplfLwLiOqZBCYRB5LWo7DHop7HDWG0al3LcigxOmoPrN7y5CUWrC0TPgD .hm2JBvPp1hNuk6SAsLaukmQUCS7iNUaUbFFMZAZXP.bdy9pC9w2K66CN4ES mMo5O9.SM95VCclBHdhAPOYie9z+Az33RbC -----------end_max5_patcher-----------
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!
Brilliant! Thank you so much for your help – this gets me started, and just what I was looking for. Perfect.
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.
Hello, could someone please explain this to me?
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.
The patcher does not seem to work (error 9505) but thank you so much for the link!
works fine here. did you make sure you copied everything including
----------begin_max5_patcher---------- and -----------end_max5_patcher-----------
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?
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.
the latest cv.jit library (updated for 64 bit and max 7) is found here, along with some instructional videos:
Forums > Jitter