[PD] #store and getting pixel data from a movie file
Mathieu Bouchard
matju at artengine.ca
Wed Aug 24 19:10:12 CEST 2011
On Tue, 23 Aug 2011, ALAN BROOKER wrote:
> I hope to ask for some tips regarding obtaining values from a loaded
> image/movie file by using gridflow ? #store gets can get rgb values
> from a specified pixel position
You can pass multiple pixel positions at once to #store and it's much
faster than getting pixels one by one. Those multiple pixel positions can
in turn be organised in rows and columns so that you can make a new image
by picking 100000 pixels in a single step, for example.
> but any advice on getting the whole dimensions at once
What does that mean ?
> (or any other techniques in getting gridflow to output values from a
> movie file such as movement, luminosity or anything)?
some kind of luminosity is what you get when you convert to greyscale. You
may use [#rgb_to_greyscale].
Movement can be a lot of different things.
The easiest one is to subtract each frame with the previous one. Then you
can know the change of luminosity from one image to the other, or the
change of each channel. You do that using [t a a] and [# -] (plain diff)
or [# sq-] (squared diff) or [# abs-] (absolute diff).
You can also identify regions or compute mean positions of things and then
look at the position differences. Sometimes I did that using [#moment] and
then [t a a] and [# -]. Note that often the same tools work on different
kinds of data (pixel colours vs pixel positions). This is a feature of
GridFlow which is not found in other image-processors of Pd (GEM/PDP/etc).
There are also algorithms to make a map of all translations (move) of
pixels in the picture, but they have not incorporated in GridFlow.
> ...also is there support for mp4 in gridflow? the file format being the
> same as mov (I think?)
GF uses Quicktime.framework (by Apple) on OSX, and libquicktime (by H.W. &
Plaum) on Linux and now also on OSX. Nearly all video file format support
rests upon that.
GF also can run libmpeg3, but that's a MPEG1/MPEG2 decoder without
plugins.
_______________________________________________________________________
| Mathieu Bouchard ---- tél: +1.514.383.3801 ---- Villeray, Montréal, QC
More information about the Pd-list
mailing list