Motion Detection using OpenCV

Parth Sojitra
1 min readJul 19, 2019

--

motion detection

Motion detection is the process of detecting a change in the position of an object relative to its surroundings or a change in the surroundings relative to an object. Motion detection can be achieved by either mechanical or electronic methods. When motion detection is accomplished by natural organisms, it is called motion perception.

In video surveillance, motion detection refers to the capability of the surveillance system to detect motion and capture the events. Motion detection is usually a software-based monitoring algorithm which, when it detects motions will signal the surveillance camera to begin capturing the event. Also called activity detection. An advanced motion detection surveillance system can analyze the type of motion to see if it warrants an alarm.

Requirements:

  1. Python3
  2. OpenCV (library)
  3. Numpy (library)

Main Logic :

Videos can be treated as stack of pictures called frames. Here i am comparing current frame(Image) to the last frame(Image) which should be static(No movements initially). We compare two images by comparing the intensity value of each pixels.

For see Example Video click here

For Code click here

--

--

Parth Sojitra
Parth Sojitra

Written by Parth Sojitra

AI researcher and passionate blog writer exploring the frontiers of artificial intelligence and sharing insights with the world. 🤖✍️ #AI #Research

No responses yet