Motion detection with webcam and the BLOB (was Re: [PD] Gem - CPU usage 98%)

klaas de Baas kdebaas at hotmail.com
Fri Jun 9 00:07:48 CEST 2006


Hello IOhannes,

<snip>

>klaas de Baas wrote:
>>Thanks for your answers.
>>
>>It is probably true that I could make a more efficient patch in which my 
>>usb webcam functions as a motion detector. (I use pix_movement followed by 
>>pix_blob to check for movement, and there might be a way of using just one 
>>pix object instead. I just didn't figure that out yet. Suggestions?) 
>>((Note that I am not texturing the gemlist of the webcaminput into the 
>>gemwin. I just want it to supply me with 1 or 0 each cycle))
>
>just to make sure: you only detect whether there is some movement in the 
>image or not? then go with the smallest possible pix-size
>make sure to do the blob-tracking only on 1 channel;
>don't do rgb->grey conversion within blob; if the capture card drivers 
>support output as greyscale you might want to try that;
>converting the image to greyscale in gem _might_ be a penalty (but as well 
>not; try it)
>if the camera can output greyscale (even if the driver supplies them as 
>rgb(a)) use this and let the pix_blob just work on any one of the channels.

I had been using pix_blob but only half understanding it. And I'm still a 
little uncertain:
- I presume that by "the smallest pix-size" you mean I should let the webcam 
capture as small a framesize as possible and a low framerate?
- What do you mean by doing rgb->grey conversion in the blob?
- In my understanding of pix_movement, it stores the movement in the alpha 
channel, and so that is the channel I let pix_blob listen to (my webcam 
outputs "RGB 24"). Why would grey be better?

And on another note - concerning pix_video:
- I know I can send the message [dialog( to the pix to call up a window for 
the webcam settings. But how do I incorporate my settings in the message 
itself? Is that possible?

Thanks for your time,
Ciao
Klaas






More information about the Pd-list mailing list