Nikolay Dyankov
Nikolay Dyankov

Reputation: 7234

Motion detection and simple analysis with JavaScript?

Lets assume that I have a video playing in canvas and I want to do some basic analysis on that video like edge detection, motion detection and general motion direction. How should I approach this problem? Can you point me in the right direction to some simple algorithms and general ideas on how to implement them?

I'm assuming that those kinds of things aren't often coded in JS, so I'm not hoping for anything working out of the box.

Any ideas?

Upvotes: 5

Views: 3443

Answers (2)

Axis
Axis

Reputation: 846

The way I have done detection is comparing one frame to the next. It is simple and effective but sometimes not very reliable. This project has some examples of motion detection algorithms: http://www.codeproject.com/KB/audio-video/Motion_Detection.aspx

Upvotes: 0

ipavlic
ipavlic

Reputation: 4966

Take a look at OpenCV library. Maybe you can then use Python with JavaScript. For that, see Python WebBrowserProgramming and Best way to integrate Python and JavaScript?.

Upvotes: 3

Related Questions