EdgeVision: User Defined Object-Counting using Raspberry Pi
EdgeVision is a real-time object detection and counting system developed on a Raspberry Pi 4 with a Camera Module V2. The system uses a Faster R-CNN detector with a ResNet-50 backbone to detect objects in live video and perform inference at the edge rather than sending the video to a remote server.
The system uses a CentroidTracker to maintain object IDs across video frames. Each detected object is represented by the center of its bounding box, and the tracker matches new detections to existing objects based on Euclidean distance between their centroids. This allows the system to maintain object identities as they move through the video.
A key feature of EdgeVision is its user-defined object counting. Users can draw a line directly on the live video feed using the mouse. The system then uses geometric line-crossing logic to determine when a tracked object's centroid crosses the selected line and updates the count accordingly. This allows different counting lines to be defined without changing the underlying code.
The project demonstrates the integration of deep learning-based object detection, real-time video streaming, object tracking, and geometric counting on a resource-constrained embedded platform. It also evaluates detection performance under different lighting conditions, with higher accuracy in bright outdoor scenes than in low-light indoor scenes.