Using motion to rotate in live feed

Physical_Graffiti's icon

I am trying to rotate live feed from a webcam, using motion.

I want to create two regions within the live feed screen, in the top left and top right corners, so when movement is detected in the top right corner, the live feed with rotate clock-wise and when detected in the top left corner, anti-clockwise. I have tried using Andrew Bensons frame difference patch and connecting it with a jit.rota, but I can't get it to work. It also seems complicated to get a simple result.

Any ideas of what would work?

Eetu Huhtala's icon

Dabbled for a while and got it to work. It is ugly but it works. Probably should give it a treshold to limit the amount of motion to capture but the actual motion detection boxes -> turning is working fine.

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

Eetu Huhtala
UncannyMotion
Helsinki, Finland

4682.ephMotionBasedTurning.maxpat
Max Patch