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:
Anthropic Claude
,Email Notification
,YOLO-World Model
,Keypoint Detection Model
,LMM
,Gaze Detection
,Perspective Correction
,Detections Consensus
,Path Deviation
,Moondream2
,Bounding Rectangle
,Model Monitoring Inference Aggregator
,Time in Zone
,Roboflow Dataset Upload
,OpenAI
,Detections Filter
,Detections Merge
,Byte Tracker
,Segment Anything 2 Model
,Slack Notification
,Instance Segmentation Model
,Camera Focus
,Detections Stitch
,Instance Segmentation Model
,Roboflow Dataset Upload
,CogVLM
,Detection Offset
,OpenAI
,Google Vision OCR
,Dynamic Crop
,Detections Classes Replacement
,Twilio SMS Notification
,Byte Tracker
,Florence-2 Model
,Detections Stabilizer
,Detections Transformation
,Template Matching
,Time in Zone
,Webhook Sink
,CSV Formatter
,VLM as Detector
,VLM as Detector
,Florence-2 Model
,Object Detection Model
,LMM For Classification
,Google Gemini
,OpenAI
,VLM as Classifier
,PTZ Tracking (ONVIF)
.md),Path Deviation
,Dynamic Zone
,Llama 3.2 Vision
,Roboflow Custom Metadata
,Line Counter
,Stitch OCR Detections
,Multi-Label Classification Model
,Single-Label Classification Model
,Identify Changes
,OCR Model
,Local File Sink
,Cosine Similarity
,Velocity
,Byte Tracker
,Object Detection Model
,Overlap Filter
,Clip Comparison
- outputs:
Blur Visualization
,Triangle Visualization
,Anthropic Claude
,Dominant Color
,Trace Visualization
,Label Visualization
,Pixel Color Count
,Absolute Static Crop
,Image Preprocessing
,Keypoint Detection Model
,Byte Tracker
,Image Threshold
,Reference Path Visualization
,Slack Notification
,Stability AI Outpainting
,Instance Segmentation Model
,Identify Outliers
,Detection Offset
,Stability AI Inpainting
,Byte Tracker
,Detections Stabilizer
,Circle Visualization
,Keypoint Visualization
,Image Blur
,SIFT Comparison
,PTZ Tracking (ONVIF)
.md),Line Counter Visualization
,Dynamic Zone
,Image Slicer
,Stitch OCR Detections
,Crop Visualization
,Corner Visualization
,Pixelate Visualization
,Image Slicer
,Mask Visualization
,Color Visualization
,Polygon Visualization
,Email Notification
,Keypoint Detection Model
,Perspective Correction
,Detections Consensus
,Bounding Box Visualization
,Instance Segmentation Model
,Twilio SMS Notification
,Detections Classes Replacement
,Halo Visualization
,Dot Visualization
,Classification Label Visualization
,Webhook Sink
,SIFT Comparison
,Object Detection Model
,Ellipse Visualization
,Image Contours
,Identify Changes
,Grid Visualization
,Stitch Images
,Byte Tracker
,Object Detection Model
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[object_detection_prediction
,instance_segmentation_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
}