In this article, I'd like to share my project to count the number of people walking past a store/shop etc. The motivation was when I was part of a family oriented digital theme park company, we would want to know if daily sales (visitors) are good enough.
First, some background. Our theme park (store) is part of a department store/shopping complex. So we did not have a large piece of land like Disneyland, where all visitors are definitely there to visit the park. In our case, visitors to the shopping complex will consider taking their children to our entertainment theme park, so we would get a certain percentage of the total visitors of the shopping complex. So for example if we have 100 visitors on one single day, how do we know if this number is good or bad? If we know the number of people passing through our store we would have a better context. If the total number of people is say around 500 then we would be getting 20%, which doesn't seem so bad. But if the shopping complex was packed and we have say around 5000 people walking past our store, that would mean that we could only generate 2% conversion, and we would then decide to do further research on why we did so badly.
Another challenge we had was to detect if there are children present. Because we are targeting families, it would not make sense without getting the number of children present.
System overview
- People detection with tensorflow
- Children detection with height estimation
- Sensor used was one webcam
- Windows 10
- Data stored to Google Sheets
Preliminary testing of height estimation algorithm
People Detection
Let's go through the modules one by one. The first component is the people detection module. This is achieved by using the model provided by Google and Tensorflow. This is easy enough since people detection models and sample code are available on the internet.
Height estimation
Height is estimated using single camera using trigonometry. The assumptions for the camera are
- Focal length is known, so the camera intrinsics and extrinsics parameters are known.
- Height of camera is known
- Angle/orientation of camera is known
At the time of this writing, I just measured the height manually and the angle was also measured visually using a protractor. Of course, this is not accurate and for future work, an automatic calibration process is needed to recover the height and angle.
The height estimation process is simply calculating the bounding boxes of people detected by the AI model and converting their height in pixels into meters.
Future work
As mentioned above, this is just a simple installation of people counter and height estimation and more work is needed to increase accuracy especially with an automatic calibration method to recover height and angle of camera placement.
Comments
Post a Comment