motion detection with webcam trigger

maggal's icon

Hello!

I have very little experience with MAX and I'm trying to create an installation with the following characteristics:

1) In a dark room where inside the room there is a projector that shine on one of the walls. This projector is only activated when someone enters the room.

2) There is a webcam directed at the entrance of the room. There will be light outside of the installation room so the background once the door opens will be bright/white.

3) As soon as somebody is standing at the entrance, they appear as a silhouette and move into the room.

4) When motion is detected, solid, changing colors (fading into each other) from a color generator patch will be shone on the wall.

5) The more the people move or the greater the amount of motion or area is detected by the webcam when entering the room or moving around the room, the quicker the transition between the colors in the projection. If there is little movement or none at all, the projection should fade to black.

I have the patch for the color generator but but I'm missing the patch for the motion detection and then the trigger that connects the colors to the motion detection.

Is there anyone out there that can please help me? I'm having an insanely hard time. Thank you in advance.

MIB's icon

Let's see what you have so far. Post your patch… someone might just tinker with it…

maggal's icon

From what I've read it seems I have to work out a threshold so that when there is movement, that would change the mean value and then that could be the trigger.

Script-Window-Audio-Online-patch.maxpat
Max Patch
Simple-structures.maxpat
Max Patch
maggal's icon

Ignore the Second attachment.

Royarinn's icon

Hi Maggal

I am doing an installation and need basically the same info as you were looking for: 1. Detection of movement (off/on) 2. the amount of movement. Did you manage to figure this out? And if so would you share this part of your patch?

terenceformer's icon

These objects may be very useful to you:
http://jmpelletier.com/cvjit/

Keep in mind that when the door opens the camera will register a huge change, so you will need to set a threshold below which data is ignored (perhaps using jit.3m).