Computer Vision
Motion detector using Computer vision
Athulya Menon
The need for security systems is rising all over the world due to an increase in crimes being committed. As the public gets more and more aware of the dangers around them, they become more willing to spend money on surveillance equipment. Not only does surveillance equipment help you keep track of what’s happening at home while you are away at the office, but it also allows you to gather evidence in case something goes wrong.
Read more..
Looking to build project on Computer Vision Based Mouse?:
Skyfi Labs gives you the easiest way to learn and build this project.
- Computer Vision Based Mouse Kit will be shipped to you (anywhere in the world!)
- Use high quality videos to understand concepts and build the project
- Get 1 to 1 expert assistance from Skyfi Labs engineers while doing the project
- Earn a smart certificate on finishing the project
You can start for free and pay only if you like it!
Nowadays we find cases wherein such cameras provide crucial evidence to help in capturing and sentencing thieves and robbers. So how do we combine a love for coding and your need for a security system? Well, this OpenCV project helps you build a simple motion detector camera which works like a surveillance camera using the most simple concepts.
Project Description
Motion detectors find large-scale applications in a wide variety of areas. This includes everything from security systems to helping robots and other autonomous systems move and interact with the environment. If you have noticed, even the hand-drying system used in most washrooms, make use of a motion detector or proximity switch to get triggered and power on and off. Certain cameras now only start recording when they detect motion within a specified range, this helps cameras save battery and prevents the wastage of storage data, helping to increase the efficiency of the security system. In this project, we will attempt to design and build a sample OpenCV algorithm or interface that links with a camera and helps with motion detection.
Concepts Used
- Fundamentals of programming
- Python Programming
- Algorithm Logic
- OpenCV
- Data segmentation
- Edge Detection
- Feature Extraction
- Background Subtraction
Hardware and Software Requirement
- A device that runs on a suitable OS such as Windows/Linux/Mac
- Enough storage on hard disk to store the database
- Enough memory to run the program
- OpenCV installed
- Python 2 installed
- Required libraries of code- Numpy, imutils, and cv2
Did you know
Skyfi Labs helps students learn practical skills by building real-world projects.
You can enrol with friends and receive kits at your doorstep
You can learn from experts, build working projects, showcase skills to the world and grab the best jobs.
Get started today!
Project Implementation
- Motion detection used the principle of background subtraction to essentially detect motion. Background subtraction is an integral part of any image processing program, as it allows the system to count the number of objects passing through the frame, and also aids with motion detection.
- Motion detection may be implemented via two methods: Gaussian Model-based segmentation and Bayesian probability-based segmentation.
- Both these methods start by segmenting the data from the foreground and background of the image, helping the system analyse the image and figure out what’s happening.
- The most basic assumption we make while building a motion detection system is that the background remains more or less static over consecutive frames, helping us model it such that it may be monitored for changes.
- However, this assumption causes problems when it comes to real world application such as external factors such as lighting, shadowing and reflections can change the way the background looks in each frame.
- To start with, import the libraries you need such as Numpy, imutils and cv2.
- Next, parse the data coming into the system, and send in path files to the video stream from a normal Raspberry Pi camera or video recorder.
- In case you don’t input a path file, OpenCV will make use of your webcam to track motion.
- Define a minimum area function that filters out small changes in the background caused due to external factors.
- Now grab the first frame of your video and start modeling it.
- Scale the frame, convert to grayscale and apply Gaussian filters to smooth the image. When the first frame has been modelled, use it as a template to compare and study the subsequent frames in the video stream.
- Use the function frameDelta that compares pixel intensity values to understand where they have been major changes in the background and foreground images.
- Apply contour and edge detection techniques to plot this figure or change in background and you will obtain the outline of the moving person.
- Any changes between frames will be detected as motion, and your surveillance camera is good to go.
Latest projects on Computer Vision
Want to develop practical skills on Computer Vision? Checkout our latest projects and start learning for free
Kit required to develop Motion detector using Computer vision:
Technologies you will learn by working on Motion detector using Computer vision:
Motion detector using Computer vision
Skyfi Labs
•
Published:
2019-11-02 •
Last Updated:
2021-07-02