Motion detector, Full body detection, Upper body detection, Cat face detection, Smile detection, Face detection (haar cascade), Silverware detection, Face detection (lbp), and Sending email notifications

Overview

Raspberry Pi Smart Security Camera

Security camera running OpenCV for object and motion detection. The camera will send email with image of any objects it detects. It also runs a server that provides web interface with live stream video.

Informations about:

  • Setup
  • Installing Dependencies
  • Saving email addresses
  • Running the Program

are available under the Functionality section.

Functionality

Email notifications

You can specify receiver's and sender's email address though web interface:

emailNotifications

After detecting an object the camera will send an email with image preview.

Email notification Email with image preview
MotionDetection MotionDetection

Object detection

You can also specify what will trigger the security alert. Here are some examples:

Motion detection

MotionDetection

Face detection

FaceDetection

Cat face detection

CatFaceDetection

Note that some of the available detectors are experimental and their accuracy leaves a space for a future improvement. Particularly:

  • Upper body detection
  • Smile detection
  • Silverware detection

Setup

This project uses a USB Camera to stream video. Before running the code, make sure you have connected a USB Camera to your device.

Installing Dependencies

This project uses openCV to detect objects in the video feed. You can install openCV by using the following tutorial. In this project Python 2.7 version was used.

The installation took about 1-2 hours on Raspberry Pi 3 Model B, but it would be considerably slower on a less powerful board like the Raspberry Pi Zero (it may even take about 8 hours).

The tutorial will prompt you to create a virtual environment. Make sure you are using the virtual environment by typing the following commands

source ~/.profile
workon cv

Next, navigate to the repository directory

cd pi-security-camera

and install the dependencies for the project

pip install -r requirements.txt

Note: If you're running python3, you'll have to change the import statements at the top of the mail_config.py file

from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage

Saving email addresses

If you don't wand to specify email addresses each time you run the app you can save them in secret.py file.

# Email you want to send the update from (only works with gmail)
from_email = ''           # '[email protected]' - must be a gmail account!
from_email_password = ''  # 'password'

# Email you want to send the update to:
to_email = ''             # '[email protected]'

Replace empty strings - '' with with your own email/credentials. Application logs into a gmail SMTP server and sends an email with an image of the object detected by the security camera..

Running the Program

Run the program

source ~/.profile
workon cv
python application.py

You can view a live stream by visiting the ip address of your Raspberry Pi in a browser on the same network. You can find the ip address of your Raspberry Pi by typing ifconfig in the terminal and looking for the inet or wlan address.

Visit :5000 in your browser to view the stream.

Note: To view the live stream on a different network than your Raspberry Pi, you can use ngrok to expose a local tunnel. Once downloaded, run ngrok with ./ngrok http 5000 and visit one of the generated links in your browser.

Owner
Peace
👨‍🏫I'm an Open source enthusiast ⚡ and 💻 passionate about AI👨‍💻. I understand you have to work hard📚 to achieve ✨ what you want in life.
Peace
This is a Computer vision package that makes its easy to run Image processing and AI functions. At the core it uses OpenCV and Mediapipe libraries.

CVZone This is a Computer vision package that makes its easy to run Image processing and AI functions. At the core it uses OpenCV and Mediapipe librar

CVZone 648 Dec 30, 2022
Balabobapy - Using artificial intelligence algorithms to continue the text

Balabobapy - Using artificial intelligence algorithms to continue the text

qxtony 1 Feb 04, 2022
Learning Camera Localization via Dense Scene Matching, CVPR2021

This repository contains code of our CVPR 2021 paper - "Learning Camera Localization via Dense Scene Matching" by Shitao Tang, Chengzhou Tang, Rui Hua

tangshitao 65 Dec 01, 2022
The virtual calculator will be above the live streaming from your camera

The virtual calculator is above the live streaming from my camera usb , the program first detect my hand and in each frame calculate the distance between two finger ,if the distance is lower than the

gasbaoui mohammed al amine 5 Jul 01, 2022
Fast style transfer

faststyle Faststyle aims to provide an easy and modular interface to Image to Image problems based on feature loss. Install Making sure you have a wor

Lucas Vazquez 21 Mar 11, 2022
Pre-Recognize Library - library with algorithms for improving OCR quality.

PRLib - Pre-Recognition Library. The main aim of the library - prepare image for recogntion. Image processing can really help to improve recognition q

Alex 80 Dec 30, 2022
Contextual speed detection for python

Speed Prediction using Optical Flow and 2D CNN About the challenge: Comma.AI Speed Challenge This challenge was developed by Comma.AI to predict the s

Mahimana Bhatt 2 Dec 16, 2021
[EMNLP 2021] Improving and Simplifying Pattern Exploiting Training

ADAPET This repository contains the official code for the paper: "Improving and Simplifying Pattern Exploiting Training". The model improves and simpl

Rakesh R Menon 138 Dec 26, 2022
Characterizing possible failure modes in physics-informed neural networks.

Characterizing possible failure modes in physics-informed neural networks This repository contains the PyTorch source code for the experiments in the

Aditi Krishnapriyan 55 Jan 02, 2023
A dataset handling library for computer vision datasets in LOST-fromat

A dataset handling library for computer vision datasets in LOST-fromat

8 Dec 15, 2022
Python library to extract tabular data from images and scanned PDFs

Overview ExtractTable - API to extract tabular data from images and scanned PDFs The motivation is to make it easy for developers to extract tabular d

Org. Account 165 Dec 31, 2022
This Repository contain Opencv Projects in python

Python-Opencv OpenCV OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was

Yash Sakre 2 Nov 06, 2021
TextBoxes re-implement using tensorflow

TextBoxes-TensorFlow TextBoxes re-implementation using tensorflow. This project is greatly inspired by slim project And many functions are modified ba

Gu Xiaodong 44 Dec 29, 2022
Can We Find Neurons that Cause Unrealistic Images in Deep Generative Networks?

Can We Find Neurons that Cause Unrealistic Images in Deep Generative Networks? Artifact Detection/Correction - Offcial PyTorch Implementation This rep

CHOI HWAN IL 23 Dec 20, 2022
Computer vision applications project (Flask and OpenCV)

Computer Vision Applications Project This project is at it's initial phase. This is all about the implementation of different computer vision techniqu

Suryam Thapa 1 Jan 26, 2022
OCR engine for all the languages

Description kraken is a turn-key OCR system optimized for historical and non-Latin script material. kraken's main features are: Fully trainable layout

431 Jan 04, 2023
Page to PAGE Layout Analysis Tool

P2PaLA Page to PAGE Layout Analysis (P2PaLA) is a toolkit for Document Layout Analysis based on Neural Networks. 💥 Try our new DEMO for online baseli

Lorenzo Quirós Díaz 180 Nov 24, 2022
[BMVC'21] Official PyTorch Implementation of Grounded Situation Recognition with Transformers

Grounded Situation Recognition with Transformers Paper | Model Checkpoint This is the official PyTorch implementation of Grounded Situation Recognitio

Junhyeong Cho 18 Jul 19, 2022
Generating .npy dataset and labels out of given image, containing numbers from 0 to 9, using opencv

basic-dataset-generator-from-image-of-numbers generating .npy dataset and labels out of given image, containing numbers from 0 to 9, using opencv inpu

1 Jan 01, 2022