Measure Position Distance
This function block calculates the horizontal, vertical and straight-line distance between two image positions. Use it when you need pixel-level spacing information between two points (format: (x, y)).
π₯ Inputs
Point First position (x, y) to compare.
Point Second position (x, y) to compare.
(hint: both inputs accept a single coordinate pair. Provide the two positions in the order you want measured.)
π€ Outputs
X Distance Horizontal difference between the two positions (absolute value, pixels).
Y Distance Vertical difference between the two positions (absolute value, pixels).
Distance Euclidean distance between the two positions (pixels).
πΉοΈ Controls
This block has no interactive controls or sliders β it simply computes distances from the provided inputs.
π― Features
Straightforward distance calculation in image pixel coordinates.
Returns both axis-wise distances and the combined Euclidean distance for easy downstream use.
Works with results produced by detection and annotation blocks (centers, landmark points, etc.).
π How to use
Provide the first coordinate pair to the first
Pointinput.Provide the second coordinate pair to the second
Pointinput.Read results from the three outputs:
X Distance,Y Distance, andDistance.Use outputs directly for visualization, logic decisions, logging or export.
π Evaluation
When evaluated, the block computes the absolute difference on X and Y axes and the Euclidean distance between the two provided positions, then outputs these numeric values.
π‘ Tips and Tricks
If you need coordinates from automatic detectors, combine with
Find ObjectorObject Detection/Object Detection - Customto obtain object centers, then feed those centers into this block.For tracked objects over time, use
Object_Detection_Trackerto get position lists and measure distances between tracked IDs.Visualize results by connecting outputs to
Draw PointorDraw Line(to draw the measured segment) and show the annotated image withShow Image.Plot live numeric values (for example distance over time) by sending the
Distanceoutput toScope.To measure distances inside a cropped region, crop first with
Image ROIorImage ROI Selectand then feed coordinates in local ROI space.If you need to compare distances between two found objects directly, consider pairing this block with
Measure Object Distancefor higher-level object-based workflows.
π οΈ Troubleshooting
If distances look incorrect, confirm both inputs are valid
(x, y)pairs and that they use the same coordinate system (full image vs. cropped ROI).If one input is missing, the block cannot compute meaningful distances β ensure both inputs are connected or guarded with blocks like
Is None/Replace Nonein larger flows.Remember results are in pixels. Convert to real-world units externally if you have a calibration or scale factor.
Last updated
Was this helpful?