Motion Detecting

Hello,
what do you think is the easyest way to detect a motion on a video-input?
The idea is, that there is a USB webcam on a PC and when somebody comes near the PC, the patch should give me an 1 or 0.
I already thought 'bout use the pipet node and when the video gets brighter i have the signal… :-/
But this would be only a bad workaround i think…?
Thanks for your help!
Olli

hello olli,

trautner detects motion in video. in your case you could load a simple map with one gray value. see the help patch for more info…

Hello, thanks - works great!
There are only two things i don’t understand yet:

-when i load a mask image and monitor it on a dShow out, the mask seems to be rotated 180°.

-when i would like to define 256 fields for detection, would i need 256 different gray values or could i also define 256 white fields?

Thanks a lot so far
Olli

Hello, thanks - works great!
There are only two things i don’t understand yet:

-when i load a mask image and monitor it on a dShow out, the mask seems to be rotated 180°.

-when i would like to define 256 fields for detection, would i need 256 different gray values or could i also define 256 white fields?

Thanks a lot so far
Olli

hello, no idea why the mask seems to be rotated…?

the destinction beteen the areas in the mask is the gray value. so you can make 256 areas each one with a different shade of gray from black (=0) to white (=255). if you paint many white areas they would all be treated as one area…

Hi, tanks!
Then i’ve one more little question i don’t want to open a new threat for:
I want to transmitt a spread wire UDP. When i only want do trnsmitt a single string, i normaly do it the following:
String–>Change–>UDP I connect the status pin of the change pin with the “do send” of udp to prohibit the nonstop sending of the UDP.
On the receiving side, i use the switch(output) to relay ony when the UDP gets is getting new stuff.
But anything doesnt work(whith spreads)
So i attach my two as sub-patch designed patches.

Hi, tanks!
Then i’ve one more little question i don’t want to open a new threat for:
I want to transmitt a spread wire UDP. When i only want do trnsmitt a single string, i normaly do it the following:
String–>Change–>UDP I connect the status pin of the change pin with the “do send” of udp to prohibit the nonstop sending of the UDP.
On the receiving side, i use the switch(output) to relay ony when the UDP gets is getting new stuff.
But anything doesnt work(whith spreads)
So i attach my two as sub-patch designed patches.

Net Receiver Olli v1.v4p (28.7 kB)

and the sender…

and the sender…

Net Sender Olli v1.v4p (24.3 kB)

looks like you have to use separate, cause it ain’t that strange…

simply use the NetSend and NetReceive modules, they do all magic for you…

Thanks tonfilm, but that’s not the way i learn it :)
NetSend seems to do it nearly the same way apart from the stack of “Add” nodes.
So i better use to understand how it works and integrate it in my own module :)