Distance Measurement¶
Class: DistanceMeasurementBlockV1
Source: inference.core.workflows.core_steps.classical_cv.distance_measurement.v1.DistanceMeasurementBlockV1
Calculate the distance between two bounding boxes on a 2D plane, leveraging a perpendicular camera view and either a reference object or a pixel-to-unit scaling ratio for precise measurements.
Type identifier¶
Use the following identifier in step "type"
field: roboflow_core/distance_measurement@v1
to add the block as
as step in your workflow.
Properties¶
Name | Type | Description | Refs |
---|---|---|---|
name |
str |
Enter a unique identifier for this step.. | ❌ |
object_1_class_name |
str |
The class name of the first object.. | ❌ |
object_2_class_name |
str |
The class name of the second object.. | ❌ |
reference_axis |
str |
The axis along which the distance will be measured.. | ❌ |
calibration_method |
str |
Select how to calibrate the measurement of distance between objects.. | ❌ |
reference_object_class_name |
str |
The class name of the reference object.. | ✅ |
reference_width |
float |
Width of the reference object in centimeters. | ✅ |
reference_height |
float |
Height of the reference object in centimeters. | ✅ |
pixel_ratio |
float |
The pixel-to-centimeter ratio of the input image, i.e. 1 centimeter = 100 pixels.. | ✅ |
The Refs column marks possibility to parametrise the property with dynamic values available
in workflow
runtime. See Bindings for more info.
Available Connections¶
Compatible Blocks
Check what blocks you can connect to Distance Measurement
in version v1
.
- inputs:
Path Deviation
,Dynamic Crop
,Object Detection Model
,Keypoint Detection Model
,Moondream2
,Clip Comparison
,Webhook Sink
,VLM as Classifier
,Roboflow Custom Metadata
,CSV Formatter
,Byte Tracker
,Segment Anything 2 Model
,Florence-2 Model
,Roboflow Dataset Upload
,OpenAI
,LMM For Classification
,Perspective Correction
,Twilio SMS Notification
,Detections Stabilizer
,Google Gemini
,Detections Consensus
,Detections Stitch
,Slack Notification
,Line Counter
,Time in Zone
,Camera Focus
,Identify Changes
,OpenAI
,Time in Zone
,Email Notification
,Local File Sink
,Florence-2 Model
,Cosine Similarity
,YOLO-World Model
,Stitch OCR Detections
,Anthropic Claude
,Detections Merge
,Overlap Filter
,Instance Segmentation Model
,Google Vision OCR
,PTZ Tracking (ONVIF)
.md),Detections Transformation
,Object Detection Model
,Llama 3.2 Vision
,Multi-Label Classification Model
,OpenAI
,Detection Offset
,Detections Filter
,CogVLM
,Single-Label Classification Model
,Roboflow Dataset Upload
,Gaze Detection
,Byte Tracker
,VLM as Detector
,Velocity
,Instance Segmentation Model
,Dynamic Zone
,Byte Tracker
,Detections Classes Replacement
,Path Deviation
,VLM as Detector
,Bounding Rectangle
,Model Monitoring Inference Aggregator
,Template Matching
,LMM
,OCR Model
- outputs:
Halo Visualization
,Keypoint Detection Model
,Label Visualization
,Color Visualization
,Circle Visualization
,Absolute Static Crop
,Perspective Correction
,Twilio SMS Notification
,Slack Notification
,Grid Visualization
,Image Preprocessing
,Image Blur
,Classification Label Visualization
,Email Notification
,Image Contours
,SIFT Comparison
,Instance Segmentation Model
,Reference Path Visualization
,Object Detection Model
,Keypoint Visualization
,SIFT Comparison
,Ellipse Visualization
,Triangle Visualization
,Line Counter Visualization
,Dynamic Zone
,Dot Visualization
,Detections Classes Replacement
,Mask Visualization
,Object Detection Model
,Stitch Images
,Webhook Sink
,Pixelate Visualization
,Image Threshold
,Corner Visualization
,Byte Tracker
,Pixel Color Count
,Detections Stabilizer
,Detections Consensus
,Blur Visualization
,Stability AI Inpainting
,Identify Changes
,Image Slicer
,Trace Visualization
,Dominant Color
,Bounding Box Visualization
,Stability AI Outpainting
,Identify Outliers
,Crop Visualization
,Stitch OCR Detections
,Anthropic Claude
,PTZ Tracking (ONVIF)
.md),Detection Offset
,Keypoint Detection Model
,Byte Tracker
,Instance Segmentation Model
,Image Slicer
,Byte Tracker
,Polygon Visualization
Input and Output Bindings¶
The available connections depend on its binding kinds. Check what binding kinds
Distance Measurement
in version v1
has.
Bindings
-
input
predictions
(Union[instance_segmentation_prediction
,object_detection_prediction
]): The output of a detection model describing the bounding boxes that will be used to measure the objects..reference_object_class_name
(string
): The class name of the reference object..reference_width
(float
): Width of the reference object in centimeters.reference_height
(float
): Height of the reference object in centimeters.pixel_ratio
(float
): The pixel-to-centimeter ratio of the input image, i.e. 1 centimeter = 100 pixels..
-
output
Example JSON definition of step Distance Measurement
in version v1
{
"name": "<your_step_name_here>",
"type": "roboflow_core/distance_measurement@v1",
"predictions": "$steps.model.predictions",
"object_1_class_name": "car",
"object_2_class_name": "person",
"reference_axis": "vertical",
"calibration_method": "<block_does_not_provide_example>",
"reference_object_class_name": "reference-object",
"reference_width": 2.5,
"reference_height": 2.5,
"pixel_ratio": 100
}