[PD] mean color value of a video grid

Mathieu Bouchard matju at artengine.ca
Fri Sep 1 18:39:50 CEST 2006


On Fri, 1 Sep 2006, vincent rioux wrote:

>>> Moreover would it be possible to compute these values on a more complex 
>>> shape than a rectangle?
>> This can mean several different things, so you should say what you mean 
>> here, in detail.
> i was refering to a possibly non-rectangular shape. i am not used to gridflow 
> but i would guess that it is possible to take the mean color over a group of 
> pixels.

Well, you could use [# *] or [# *>>8] or [# &] to apply a bunch of masks 
to your picture. Use [# *>>8] if your masks have values ranging from 0 to 
255. using [# &] is faster but works only if the masks contain only 0 and 
255.

Else, if the holes in your masks are all the same shape, possibly fuzzy, 
and evenly spaced all over the picture, you could use a convolution 
followed by a [#downscale_by] without "smoothly". This may waste a lot of 
resources but it may be easy to do. If your mask is small, or if your mask 
is big but with few non-zero values, use [#convolve]. If your mask is big, 
pad it using [#border], and then use [#fft] and [# C.*] to make a 
super-fast convolution.

There is not a specialized object to do what you want to do in GridFlow, 
but there's a lot of possibilities that you can cook yourself.

  _ _ __ ___ _____ ________ _____________ _____________________ ...
| Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju
| Freelance Digital Arts Engineer, Montréal QC Canada


More information about the Pd-list mailing list