When jit.faces doesn't detect a face, show a previous frame?

Oct 16, 2013 at 3:06pm

When jit.faces doesn't detect a face, show a previous frame?

Hey guys, I’m new to Max but really like it so far (though it does have a bit of a steep learning curve..at least for me).

I’m using cv.jit.faces to detect my face on a webcam with cv.jit.grab, which is working fine so far.
However when no face is detected, I would like to show a previous frame/picture of my face until a face is detected again.

I *think* I need to export the current matrix each time I do get a face detection and then store it somehow for when I don’t get one?
Could you please send me in the right direction?

Thanks a lot!

Oct 17, 2013 at 4:14pm

I hate to sound impatient, but the deadline for this project is tomorrow ;)
Any help would be greatly appreciated!

Oct 17, 2013 at 8:59pm

If you post a patch it might be easier for people to help…

Oct 18, 2013 at 12:32am

Right, sorry, this is the basic setup:


– Pasted Max Patch, click to expand. –


So maybe I could add an if-statement, checking to see if the ouput coordinates <= 0 (no face detected).
However, I don't know what do from there: how to store the current frame if there is a face and how to show that frame when there is no face.

Oct 18, 2013 at 1:18am

Ok, made a little progress by using a gate and send/load bang to switch between the stream and previous frame.
Now all that’s left is getting that previous frame.

Oct 18, 2013 at 2:09am

Solved by using a trigger.

Oct 18, 2013 at 8:44pm

how about this? no previous frame here, but it only outputs a frame if a valid face has been found.


– Pasted Max Patch, click to expand. –



You must be logged in to reply to this topic.