Considering the unfortunate circumstances due to COVID-19, keeping distance among people is crucial. And to find the distance, we can set the goal to detect people using Deep Learning first and then find the distance between them to check whether a norm of social distance of about 6 feet or 1.8m is maintained by people.
Tools and Libraries
- Step 1: Find the number of people in the frame/Image.
- Step 2: Create Bounding Box over the people identified using YOLO.
- Step 3: A width threshold is set for object among which the distance is measured i.e. the width of the people. I am setting width as 27inch or 0.70 meter. Try other values if required.
- Step 4: Mapping the pixels to metric (meter or inches).
- Step 5: Find the distance between, the center point of one person to another person in meters.
The blog isn’t about YOLO or any Object Tracking architecture for deep learning, will share details of blogs which explains why YOLO is better that other RCNN architectures.
Pixel per Metric
Pixel Density is the measure of pixels per inch(ppi) or pixel per centimeter of an electronic device. It is defined as number of pixels found per inch. Consider the smartphone Oneplus 5t, which has around 402 ppi. It means the number of pixels in an inch is 401 and thats why we get an clear resolution of an image. Greater the density, greater is the quality.
Consider the image of Peaky Blinders, we can see that each character is set apart from each other in some distance. If we think about the pixels of the image, then each of the character occupies some number of pixels on the image and each person has width associated with them. For instance, in the image above the women standing at the left occupies first 200 pixels in x-axis with width of her body as 30 inch then we can make use of this ratio 200/30 to get Pixel per inch.
We can then utilize this ratio value to find distance between the bounding boxes of other people in the frame to measure where each person is located. The task can be extended to a video and also for real time applications.
👏 if you liked it !
Today's unfortunate circumstances due to COVID-19, keeping distance among people is crucial. The goal is to detect…
YOLO vs RCNNs
Hello Everyone ! This repo contains both the basics and advance topics of Computer Vision, along with Implemention…