Methodologies
Our workflow was divided into two main segments,
- Optimization of the videos.
- Human Object Detection and tracking on videos.
Optimization of the videos
Optimizing the video to make it as light as possible for the algorithm to work smoothly and achieve speed. A video is nothing but a sequence of images, hence achieving the objective of identifying the object at the lowest-most level of an image will result in achieving the same on a video by iterating the process on all the images that the video is made up of.
Optimization includes :
- Turning the image/video into grayscale
- Reducing the image/video to the pure black white form
- Masking the image/video
- Reading video frames
Human Object Detection & Tracking on videos
For object detection and tracking, we used OpenCV and ImageAI. The object detection and tracking work for recorded videos as well as a live feed directly from different types of cameras.
Object detection and tracking include:
- Using the camera for live-feed video
- Using existing video footage
- An in-out tracker using opencv and object detection and counter method
- Finally a web app as a GUI for the analysis of the detection and tracking results of the supermarket and retail stores that is done using streamlit.
Object detection and tracking method
We are accepting a set of bounding boxes of a person and compute their respective centroids and then compute the Euclidean distance between any new centroids and existing centroids to track the movement.
When centroids intercept the gate line from the top of the frame the IN counter is incremented and when the centroids intercept from down the frame OUT counter is incremented. And hence we can count the number of people in the defined zone.
Project Idea – Object Detection and Tracking
Project title: Object Detection and Tracking
Introduction: A lot of people go to supermarkets and retail stores and shops to idle around and window-shop instead of purchasing any products. The thought of analyzing this kind of behavior was intriguing.
- How does this kind of behavior affect product sales?
- What time periods these people were coming in?
- What could help the owners count the number of customers by cross-referencing the billing data, but how do you count the people who haven’t shopped?
Object detection and tracking is one of the areas of computer vision that is maturing very rapidly. It allows us to identify and locate objects in an image or video. With this kind of identification and localization, object detection and tracking can be used to count objects in a particular scene and determine and track their precise locations, all while accurately labeling them.
In this project, we have made use of two of the most popular Python libraries for object detection, OpenCV and ImageAI.
Every supermarket nowadays has at least one CCTV camera installed. And the data is stored in a centralized repository with a timestamp. Our end goal was to identify the people coming in and going out of the supermarket or retail store, and categorize them under the labels “customer” or “not a customer”. By achieving this goal we could calculate the actual cost per customer.
Contact Us