How To Smooth Tracking Data ?

f.e's icon

Hello,

I've tried [smoother] by T. Jehan but i don't know if it's doing what i
want. My friend on pd uses [median_n] and [average] but i can't find the
same ones or an equivalence on Max.

I'm using reactivision to do my tests at home, and my webcam really
sucks (7fps !!). It may not help, for sure.

I need to smooth incoming x,y position, int or float doesn't matter.

thanks in advance

f.e

--
f.e chanfrault | aka | personal computer music
>>>>>>> http://www.personal-computer-music.com
>>>>>>> |sublime music for a desperate people|

Emmanuel Jourdan's icon

On 5 nov. 07, at 17:44, f.e wrote:

> Hello,
>
> I've tried [smoother] by T. Jehan but i don't know if it's doing
> what i want. My friend on pd uses [median_n] and [average] but i
> can't find the same ones or an equivalence on Max.
>
> I'm using reactivision to do my tests at home, and my webcam really
> sucks (7fps !!). It may not help, for sure.
>
> I need to smooth incoming x,y position, int or float doesn't matter.

[mxj ej.mmmm] does a median filter.

ej

Leafcutter John's icon

You can probably achieve the desired result using the line object.

John.

Kasper's icon

>Hello,
>
>I've tried [smoother] by T. Jehan but i don't know if it's doing
>what i want. My friend on pd uses [median_n] and [average] but i
>can't find the same ones or an equivalence on Max.
>
>I'm using reactivision to do my tests at home, and my webcam really
>sucks (7fps !!). It may not help, for sure.
>
>I need to smooth incoming x,y position, int or float doesn't matter.
>

smooth and fsmooth made by david rokeby work very well

would you be on mac (;-)) i could've send them to you!!!

but there might be a win version (smooth is not on maxobject it seems)

best

kasper
--
Kasper T. Toeplitz
noise, composition, bass, computer
http://www.sleazeArt.com

Peter Castine's icon

You can use lp.stacey for averaging. Stacey takes an optional argument to specify a window size, ie a number of data points to average over.

Trond posted an example patch doing exactly what you want, but it was quite a while ago. Take a look at lp.stacey.help. If that doesn't get you going, drop me a line and I'll find Trond's patch. It's in here somewhere.

f.e's icon
jasch's icon

i'd recommend using [slide] as it can be tuned for different
smoothing values depending on the direction of change of the data.
it's in the standard distro since max 4.6.x

/*j

yair reshef's icon

also check lbyl (lookBeforeYouLeap)
http://maxobjects.com/?v=objects&id_objet=3772

On 11/5/07, Peter Castine wrote:
>
> You can use lp.stacey for averaging. Stacey takes an optional argument to
specify a window size, ie a number of data points to average over.
>
> Trond posted an example patch doing exactly what you want, but it was
quite a while ago. Take a look at lp.stacey.help. If that doesn't get you
going, drop me a line and I'll find Trond's patch. It's in here somewhere.
> --
>
> Peter Castine
> Next Concerts: Sat 4 Nov 5:00pm, Apostel-Paulus Kirche, Berlin-Hermsdorf
> and
> Sun 5 Nov 7:30 pm, Centre Bagatelle, Zeltinger Str. 6,
Berlin-Frohnau
> both performances with Lillevan
>

Wesley Smith's icon
Stefan Tiedje's icon

f.e schrieb:
> My friend on pd uses [median_n] and [average] but i can't find the
> same ones or an equivalence on Max.

I am always after creating Pd equivalents. My abhaXed versions of the
above mentioned (the median is greatly enhanced compared to the
median_3/5/7 of Pd... ;-):

Max Patch
Copy patch and select New From Clipboard in Max.

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

lists@lowfrequency.or's icon

someone also posted a media mxj object to the list a long time ago,
that i've adapted and love.
as Wesley said, you really want a median filter. then you can plug
that into an average or slide. i use it for timing (push a button 3
times, get the average time...) because a median filter ignores
really high or really low values (relatively)

Cheers
Evan

save as lfo.mediantap.mxb:

Max Patch
Copy patch and select New From Clipboard in Max.


Peter Castine's icon

Cute patch.

The hardcore bit-manipulator would do [p EVEN_OR_ODD] as follows:

Max Patch
Copy patch and select New From Clipboard in Max.

And (this is a minor quibble) for reusability I would recommend moving the [+ 1] object outside the EVEN_OR_ODD subpatch. Or even delete the [+ 1] altogether and replace the gate object with a gSwitch2. There are a couple of other little tweaks one could make, but the thing works.