Forums > MaxMSP

calculate speed of changing floats & detect activity

Apr 21 2012 | 7:08 pm

Hi,
i have built a patch (jit) to detect direction of movement in front of
a camera (with cv.jit.lkflow).
now i want to calculate the energy/speed of motion.
x=s(t)/t
s = [(last float value)-(first float value)]* (-1)
t= (time of last float value) – (time of first float value)
is anybody good at math? ( :

i need to know:
> when does movement start/ end (by a threshold time gap between float/bang(?) )
> time in between

objects that i have reviewed:
counter, timer

i don’t get it.. ) :
Probably there is another way to solve this problem, but I’m too stupid!

thank you
greetings

``````
-- Pasted Max  Patch, click to expand. --

```
```
Apr 21 2012 | 10:16 pm

Hi Fluxus,

You probably don’t need the time if you’ve got a reasonably consistent frame rate.

Rather than multiply your difference by -1, consider just taking the absolute value instead: [abs 0.]

hth

Apr 22 2012 | 12:45 am

yeah, that’s a good idea!
thank you.
do you know a object that stores the values in a way, that the operations can be processed?

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP