Skip to content

Aim: To use the raspberry pi camera as a CCTV camera which records only when motion is detected.

Notifications You must be signed in to change notification settings

arhangoyal/CCTVFeedController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

CCTVFeedController

Aim: To use the raspberry pi camera as a CCTV camera which records only when motion is detected.

Imagine a scenario wherein something gets stolen from your house. With a normal security camera set up at your door, you'd have to go through hours of footage to get to the time when someone entered your house. Meanwhile, the thief could be using this precious time to cover his tracks and escape.

However, with this program in place, you’d be able to easily access points where movement happened at your front door, making the process more efficient. Not only does it make reviewing feed easier, but is also easy and inexpensive to implement since it is very lightweight. It can easily be run on a raspberry pi.

The program runs repeatedly and when ended, it shows the date and time of the recordings in a tabular form, using a CSV file of the format:

S.No. File Name Start Time Date

Classifying Feed as "Moving" or "Stationary"

This program calculates the Root Mean Squared Error (RMSE) between the RGB values of successive images clicked at 2 second intervals. If RMSE > 50, then feed is classified as "moving", else it is classified as "stationary".

Logic:

  • If the camera is not recording and RMSE > 50, then recording is started
  • Else if the camera is recording and RMSE < 50, then recording is stopped
  • Else do nothing

Supplies

  • Raspberry Pi 3b+/4b+
  • Raspberry Pi Camera Module V2
  • Power Supply for Raspberry Pi
  • HDMI/Micro-HDMI cable or VNC server installed on Raspberry Pi

Physical Connections

projectPic Connect the camera module to the raspberry pi's camera port.

Raspberry Pi Setup

For this project, I installed Raspbian and the required libraries (as declared in the program) on a Raspberry Pi 4b+.

Run the Progam

I ran the program cctvFeedController.py using Thonny.

Output

If all goes well, your output should look like this:

- Terminal Output

output_pic1 output_pic2

- Video Files Created

output_pic3

- CSV File Written

output_pic5

Social:

Feel free to reach out to me in case of any queries. I'll try to reply to all questions within 24 hours.

Do share your comments. I'd love to hear about your experience while trying out the project!

  1. YouTube:
    a. Scientify Inc
    b. Scientify Hindi
  2. Linkedin
  3. Instagram
  4. Instructables

About

Aim: To use the raspberry pi camera as a CCTV camera which records only when motion is detected.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages