How ebenkouao/smartcctv-camera works
Project Type & Purpose
• It is an IoT surveillance system built for the Raspberry Pi with live video streaming and face recognition.
• The system captures a live video feed, performs face recognition (using OpenCV/face_recognition libraries), and even provides a touchscreen-controlled servo to rotate the camera.
• Notifications (via Email) are mentioned in the README to alert users when a known/unknown person is detected.
Main Components
a. Camera Module:
– Represented primarily by camera.py.
– It handles capturing image/video input from the Raspberry Pi Camera Module.
b. Face Recognition Engine:
– Implemented in the scripts: facerec_pi_test.py and facerec_pi_test_profiles.py.
– Use of external libraries (like dLib and face_recognition) for detecting and recognizing faces.
c. Servo Control Module:
– Shown as servo.py.
– Controls the mechanical movement (pan/rotate) of the camera, likely via a touchscreen interface.
d. Web Server & Streaming Interface:
– main.py acts as the orchestration layer to start the streaming and possibly coordinate the different modules.
– The "templates" directory (with index.html) is used for rendering the live feed to the client’s browser, showing how the UI is served.
e. Profiles/Data Persistence:
– The "profiles" directory contains saved profiles/databases for recognized faces.
f. Static Assets:
– The "img" directory holding screenshots and images that support documentation and UI aesthetics.
Relationships and Interactions
• main.py is the central controller – it initializes the camera, starts the web stream, and ties in the facial recognition.
• The Camera Module (camera.py) feeds video frames to the Face Recognition Engine.
• The Face Recognition scripts process the captured frames – compare against stored profiles (from the "profiles" directory), and trigger notifications.
• The Servo Control (servo.py) component is used to mechanically adjust the camera view, which may be activated based on user input (possibly integrated via the touchscreen) or automatic triggers.
• The Web Server component serves the live streaming feed using the template (templates/index.html), making the camera accessible from any device.
Architectural Patterns & Design Principles
• Separation of Concerns: Each main functionality (capturing image, face recognition, servo control, web serving) is handled in its own script/module.
• Modular Design: With separate Python files for camera, facial recognition tests, servo control, and a distinct profiles repository for data, the architecture encourages maintainability and future extensions.
• Use of External Libraries: Integration of established libraries (OpenCV, face_recognition) is central to the face detection/recognition functionality.
Final Touches
• Every component is clearly labeled.
• Keep it detailed but clear – list out every logical module and connection as derived from the project file structure and README.