[PD] GEM: video analysis
IOhannes m zmoelnig
zmoelnig at iem.at
Tue Jul 25 18:10:33 CEST 2006
hi.
sorry for the late reply. i was on holiday....
Florian Walter wrote:
> Hallo,
> I would like to do some video analysis to control the playback of
> audio files. pix_movement and pix_blob work quite well, but now I
> would like to go into details and have some questions:
>
> - How can I apply a color filter to an image?
> I would like to distinguish the movement of different colors...
use [pix_rgb2hsv] to convert the image into HSV-colorspace (the actual
colorspace is still GL_RGBA, but the "red" channel will be "hue",...)
then use [pix_curve] to mask out the colors ("hue") that you don't want.
finally use [pix_blob] only on the 1st channel ("hue").
i attach i (quite chaotic) patch that should show you the idea (it does
NOT do motion-tracking but simple colortracking instead)
>
> - Is there an object that returns the total brightness of an image? Or
> are there other possibilities to detect the "amount" of movment in
> a video?
the last outlet of [pix_blob] is the size of the blob, which is
proportional to the amount of movement.
> (I read about pix_mean_color in the archives but I can't find it in
> gem 0.90.1...)
there is an experimental binary for w32 available on the download site
at http://gem.iem.at
for self-compiling check out the CVS.
>
> - I would like to recognize whether big blocks of a single color or
> fine noise-like structures are moving. Downsamling might be a good
> solution to get away the fine structures and to reduce the number of
> pixels inside of a colored block that are not recognized as moving.
> pix_resize didn't change anything (are there any parameters I
> can pass to that object?) and needs lots of computing power...
> Any ideas how to solve this problem?
try to capture with the lowest feasible resolution in the first place.
[pix_resize 32 32] should resize your image to 32x32 pixels.
[pix_movement] takes an optional arugment to set a threshold: if the
movement in a pixel is smaller than the threshold, it is not taken into
account. (but you still cannot detect, whether you have a number of
small blobs or as single bigger one)
with [pix_convolve] you can do lowpass-filtering of the image (and
hopefully get rid of noise)
[pix_multiblob] (i doubt whether this is in the 0.90.1 release) is a bit
more sophisticated, as it returns not only the size ("total brightness")
of each individual blob but also the area covered by the blob
hope this helps.
mfga.sdr
IOhannes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: color_track.pd
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20060725/4a0126de/attachment.asc>
More information about the Pd-list
mailing list