LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get caliper result?

I’m developing with the NI Vision C Support DLL and trying to get edge pair results using imaqCaliperTool(), but I’m not getting any results.

I couldn’t find any relevant information in the user manual, so I’d appreciate any guidance on how to use it.

 

I tested it using the code below and used the endpoints of the green line(in the bracket image from the example as input points.

std::vector<Point> points{ { 14, 156 }, { 549, 156 } };

EdgeOptions edgeOption;
edgeOption.threshold = 25;
edgeOption.width = 3;
edgeOption.steepness = 0;
edgeOption.subpixelType = IMAQ_BILINEAR_FIXED;
edgeOption.subpixelDivisions = 4;

CaliperOptions caliperOptions;
caliperOptions.polarity = IMAQ_RISING_FALLING;
caliperOptions.separation = 0.f;
caliperOptions.separationDeviation = 0.f;

int numEdgePairs = 0;

auto caliperReport =
	imaqCaliperTool(d->image, points.data(), points.size(), &edgeOption, &caliperOptions, &numEdgePairs);
std::cout << "Number of edge pairs: " << numEdgePairs << std::endl;

 

화면 캡처 2025-02-05 093916.png 

0 Kudos
Message 1 of 2
(130 Views)

Hi, 
Have you tried using the imaqRoiProfile function to get the Pixel Coordinates as the point input for the imaqCaliperTool function? 
If we check on NI Vision for LabVIEW documentation for IMAQ Caliper Tool function;

Pixel Coordinates is an array containing the coordinates of the pixels to inspect. You can obtain the pixel coordinates from an ROI descriptor using the IMAQ ROIProfile VI.

IMAQ Caliper Tool VI

Probably you need to call the imaqRoiProfile function to get the Pixel Coordinates and use that on the imaqCaliperTool function.

If the answer above helps, please give a kudos. Thanks!

Regards,

Gus Erwin

 

0 Kudos
Message 2 of 2
(45 Views)