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