Social Distance Detector

This function block is designed to monitor social distancing in a scene by detecting people and measuring the distances between them using computer vision techniques.

πŸ“₯ Inputs

Image Any A stream or image from which individuals will be detected and analyzed for social distancing.

Perspective Matrix A matrix used for perspective transformations to correct the view based on the camera setup.

Distance Threshold A numerical value defining the minimum allowable distance between individuals. If this threshold is breached, it is considered a violation.

πŸ“€ Outputs

Image Any The output image that shows the positions of detected individuals and lines connecting those who are too close.

Person Count The total number of persons detected in the image.

Violation Count The number of pairs of individuals that are breaching the defined social distance.

Is Violated ? A boolean output that indicates whether any violations of social distancing have occurred.

πŸ•ΉοΈ Controls

Confidence Ratio A slider that allows you to set the confidence level required for detection to be considered valid.

🎨 Features

Real-Time Detection The block processes incoming video streams or images to detect individuals and assess their distances.

Distance Measurement Automatically measures distances between detected individuals, noting any violations of the threshold.

Visual Feedback Displays circles around detected individuals and lines indicating violations.

πŸ“ Usage Instructions

  1. Connect Input: Link an image or video stream to the Image Any input.

  2. Set Perspective Matrix: If necessary, provide a perspective transformation matrix to ensure accurate distance measurements.

  3. Define Threshold: Set a desired distance threshold using the Distance Threshold input.

  4. Adjust Confidence Ratio: Use the slider to set the confidence required for detection. A higher ratio increases the strictness of the detection.

  5. Analyze: Run the block to monitor social distancing among detected individuals.

πŸ“Š Evaluation

When executed, this function block analyzes the input image, detecting individuals and evaluating their distances to provide visual and quantitative feedback regarding social distancing.

πŸ’‘ Tips and Tricks

Improving Detection Accuracy

Ensure clear visibility of individuals by avoiding obstructions. Also, use good lighting conditions to help the detector identify people more reliably.

Adjusting Threshold Values

Carefully choose the distance threshold based on the context (e.g., 1.5 meters or 6 feet). Adjust it according to your monitoring needs.

Calibrating Perspective Matrices

If the perspective matrix significantly changes, measure distances manually to calibrate and ensure that correct matrix values are provided.

Handling False Positives

Experiment with the Confidence Ratio slider to minimize false positives in crowded scenes or when individuals are partially occluded.

πŸ› οΈ Troubleshooting

No Persons Detected

If no persons are being detected, ensure that the input image is clear and contains recognizable human figures. Adjust lighting, focus, or camera angle if necessary.

Violation Count Too High

If the violation count seems too high, double-check the distance threshold setting and ensure that the detected positions are accurate.

Last updated