OpenCV: Motion Detection

This project uses a webcam connected to the host desktop/laptop. Using image subtraction from the input of the webcam the program catches motion. Depending on the region where motion is detected Megaman will perform a certain action.

The program makes use of OpenCV 2.1 to connect a webcam, show windows and calculate differences in inputs.

Features:

  • Motion in the upper left corner makes Megaman run.
  • Motion in the upper right corner makes Megaman jump.
  • Defining threshold of difference between captures
  • Defining size of ROI

Code:
Github – Source code