5

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?

sirhc
  • 6,097
  • 2
  • 26
  • 29
Nikolay Dyankov
  • 6,491
  • 11
  • 58
  • 79

2 Answers2

3

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?.

Community
  • 1
  • 1
ipavlic
  • 4,906
  • 10
  • 40
  • 77
  • Okay, so I found exactly what I was looking in there - http://opencv.willowgarage.com/documentation/motion_analysis_and_object_tracking.html and more specifically, the CalcGlobalOrientation() function. But a few questions - why do I have to pass a mask as a parameter, and what's "mhi – Motion history image"? – Nikolay Dyankov Jan 05 '12 at 13:49
  • [This post](http://stackoverflow.com/questions/5880311/how-can-i-detect-direction-and-number-of-objects-using-emgu) has some on this type of task. – karlphillip Jan 13 '12 at 16:56
  • Hi, links are gone, subdomain is dead – Codebeat Jul 18 '19 at 23:19
0

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

Axis
  • 826
  • 7
  • 22