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

  1. Provide the first coordinate pair to the first Point input.

  2. Provide the second coordinate pair to the second Point input.

  3. Read results from the three outputs: X Distance, Y Distance, and Distance.

  4. 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 Object or Object Detection / Object Detection - Custom to obtain object centers, then feed those centers into this block.

  • For tracked objects over time, use Object_Detection_Tracker to get position lists and measure distances between tracked IDs.

  • Visualize results by connecting outputs to Draw Point or Draw Line (to draw the measured segment) and show the annotated image with Show Image.

  • Plot live numeric values (for example distance over time) by sending the Distance output to Scope.

  • To measure distances inside a cropped region, crop first with Image ROI or Image ROI Select and 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 Distance for 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 None in 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?