Get Real World Distance Units Rather Than Pixels of an Image

Updated May 12, 2023



  • Vision Assistant

I am taking several images with my camera and using Vision Assistant to measure them. I want to know the distance between the specific points, but I only get the pixel coordinates as shown in the following picture. How can I convert the pixel coordinates to real-world coordinates like inches or millimeters?

To use real world units, you will need to calibrate before using Vision Assistant.
  1. Get a picture with a known size to use as the calibration image.
  2. Choose image calibration function and select New Calibration button.
  3. Choose the first calibration type, Point Distance Calibration
  1. Choose the calibration image. Click Next
  2. Set up the calibration image. For example, as shown below, we need to select two points and give their real world distance filled in the Real World input. Here we select an original point and an X-axis point, and specify the actual distance as 20 mm.
  1. Click Next, the following settings can all be default.
  2. Save the calibration image and get the calibration image as follow picture. Then click OK.
  1. ​Choose Clamp (Rake) function, and select the point you want to measure, and get the real-world value as shown below.

Additional Information

You may also use other calibration types by referencing the NI Vision Help.

Usually the measured image and calibration image are different. Make sure all the images are from the same camera and the calibration file is for the calibration image you have selected.