Skip to content
This repository has been archived by the owner on Nov 26, 2019. It is now read-only.

NJACKWinterOfCode/UltimateSecurityCam

 
 

Repository files navigation

UltimateSecurityCam


An easy-to-build , un-hack-able security camera which is impossible to fool . "Beginner Friendly"

forthebadge forthebadge

Working demo video here
To ask doubts and staying in touch , join our gitter channel

Chat at gitter


Table of content


Introduction

(Back to top👆🏻)

  • This is a security camera software which detects any intruder and alerts the owner .
  • This is the basic prototype , we'll make it un-hack-able by using microphone and eliminating every possible hack to fool our software.
  • Many issues are up-for-grabs. Check them out from issues tab.

Technologies:

How it works?

We take a snapshot of the room , lets call this base.jpg. Now , the code continuously scan the current frame and subtract it from base.jpg. If the difference is more than a threshold , we'll consider a breach happening.

Features

  • Detects any kind of unwanted movements or disturbances in the surroundings.
  • Capable of differentiaing day and night or darkness in the surroundings.
  • The program is integrated with automatic recording feature whenever it detects darkness or lights being off. So that when the camera can not identify intruders in dark the sound can be recorded, making the camera foolproof.
  • The program automatically clicks snapshot and saves the image as 'image.jpg' which show maximum movement in it's complete cycle.

Step by step guide

(Back to top👆🏻)

  • Installation of all the required depedencies is completed first. Setup
  • The code is made to run via terminal/IDE. Running
  • Sequence of code:
    • The Graphical user interfaces initializes. When user presses Run button the main program executes in a new window.
    • The code first initializes a three seconds waiting camera window.
    • The main code runs to detect movements and record the complete video footage.
    • The code is also capable of detecting darkness in the surroundings, by calculating the average brightness by overall pixels of a frame. It indicates the user whenever it finds surroundings getting dark.
    • Whenever the program detects darkness it initializes the microphone to record the audio in the region.
    • The code takes snapshot of the frame with maximum movement count asimage.jpg during it's complete execution cycle.
    • All the configurations of the video clip are recorded (like Date and Time, camera fps, maximum object movement recorded at a time, duration, etc.)
    • The video clip saved as basic_motion_detection.avi and the audio as audio.wav.
    • The GUI makes confirmation for saving the config file.
    • The configuration data like camera fps, duration of running, maximum object recorded, video file location is saved in config.txt for future reference.
    • Finally the code terminates with the termination of the main GUI window.

Setup instructions

(Back to top👆🏻)

Initialisation :

  • To install the required packages use the following command in command prompt[windows] OR terminal[Unix]
 sudo python3 setup.py install

Packages can also be installed using pip-install Tutorial.

  • Install imageAI
pip3 install https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl
  • Download the RetinaNet model file that will be used for object detection via this link.

If there be any issue please check out imageAI.

  • For object detection over video install files from the link

Note: Save the downloaded files in PythonCode directory.


Running instructions :

Working on the code:

  • Windows: Open up gui.py in your preferred python IDE
  • Linux: Open the terminal in the PythonCode directory, copy the code python3 gui.py and run it.
  • More formally , fork the code , and clone it your machine . I recommend that you use the GitHub desktop app.
    • If you need a python IDE , I recommend using pycharm. Tutorial to install !.
    • If you get an error , make sure all the import statements are working (required packages are installed)

Running

(Back to top👆🏻)

UltimateSecurityCam running on Linux

Command (with PythonCode as the working directory): python3 gui.py

ultimatesecuritycam

Running instructions:

  • Open up gui.py in your preferred python IDE UltimateSecurityCam.py
  • Open up gui.py in your preferred python IDE UltimateSecurityCam.py or run on command prompt using the command (in PythonCode directory) run the command python3 gui.py.
  • Run using python 3.6 (recommended).
  • The program takes 3-second waiting time, after that it starts detecting motion , making an alert sound.

Many improvements and developments are in the pipeline! To know more, contact on github or niteshx22@gmail.com


Get in touch

(Back to top👆🏻)

Contribute

Found a bug, please create an issue

Made with ❤ by Nitesh Chaudhry