This project is an intelligent surveillance access control system that uses computer vision and deep learning techniques to detect and recognize individuals and grant access based on their identity. The system uses a Raspberry Pi 4 with a camera module to capture images and videos, and an Azure Cognitive Services Custom Vision for student card detection and a local Face Recognition library to perform facial recognition.
To run this project, you will need the following hardware and software:
- Raspberry Pi 4
- Micro HDMI Adapter
- Type C Cable
- Raspberry Pi Camera Module / USB Webcam
- RGB LED
- PIR Motion Detection
- 7 Jump wires
- Raspbian OS legacy
- Python 3.7+
- OpenCV 4.7.0
- Azure Cognitive Services API subscription
- Face_recognition
- gpiozero
To install Raspbian OS legacy on Raspberry Pi 4, follow these steps:
- Download the Raspbian Buster with desktop (legacy) image from the official Raspberry Pi website.
- Flash the image onto a microSD card using a software like BalenaEtcher.
- Insert the microSD card into the Raspberry Pi and power it on.
To build OpenCV from scratch on Raspberry Pi 4, follow these steps:
- Install the dependencies:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt-get install python3-dev python3-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libdc1394-22-dev
- Clone the OpenCV repository:
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 4.7.0
cd ..
- Clone the OpenCV contrib repository:
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout 4.7.0
cd ..
- Create a build directory and navigate into it:
mkdir build
cd build
- Configure the build using cmake:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules \
-D ENABLE_NEON=ON \
-D ENABLE_VFPV3=ON \
-D BUILD_TESTS=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF ..
- Build and install OpenCV:
make -j4
sudo make install
sudo ldconfig
To use this project, follow these steps:
- Clone the repository:
git clone https://github.com/<username>/Intelligent-surveillance-access-control-system.git
cd Intelligent-surveillance-access-control-system
- Install the required Python packages:
pip install -r requirements.txt
- Update the
subscription_key
andendpoint
variables in theSystème de surveillance automatisé.py
file with your own Azure Cognitive Services subscription key and endpoint and the prediction key for your trained model - Run the
Système de surveillance automatisé.py
script:
python "Système de surveillance automatisé.py"
Contributions are welcome.