Forums > MaxMSP

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

October 16, 2013 | 3:06 pm

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!


October 17, 2013 | 4:14 pm

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



MIB
October 17, 2013 | 8:59 pm

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


October 18, 2013 | 12:32 am

Right, sorry, this is the basic setup:

<code>

– Pasted Max Patch, click to expand. –

</code>

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.


October 18, 2013 | 1:18 am

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.


October 18, 2013 | 2:09 am

Solved by using a trigger.



MIB
October 18, 2013 | 8:44 pm

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

<code>

– Pasted Max Patch, click to expand. –

</code>


Viewing 7 posts - 1 through 7 (of 7 total)