detect sequence going up/down

yair reshef's icon

above my hand are 6 sensors
moving under these sensors, is my hand moving left or right
ideally i'll know at what speed.

might be able to pull this off with cv.jit.lkflow.
it does "pixel flow calculation". but this seems an overkill

suggestions?

jamesson's icon

You need to be clearer about the nature of the sensors.

If you have some kind of stable datarate and x/y coords you can do standard math calculation for direction (0) and speed (distance/time).

If you only have on/off, you must number the sensors and use some timer to see the time between one coming on and the other coming on. Then simply subtract number of the first sensor from the last and see whether you moved left (negative) or right (positive).

Best

Joe

yair reshef's icon

thanks, ill go that way