LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Calibration Image

 Hi,

 

 I have image of object . I am finding two edge points using edge detection vi. Now I want to create calibration image programmatically, which similar to Point distance calibration in vision assistant. How create calibration image using above information.

0 Kudos
Message 1 of 5
(2,545 Views)

Hello,

 

You can prototype this in Vision Assistant, then generate the LabVIEW code to see how to implement it in LabVIEW.

From Vision Assistant, in the Machine Vision palette, select the Edge Detector step. Draw your line ROI, then click OK to insert the step in the script.

Then Select the Image palette. Scroll down and select the Image Calibration step.

Click New calibration.

Select Point Distance Calibration. Click Next twice.

Check the 2 points from the Edge Detector step.

Enter the corresponding real world distance and unit. Click Next twice.

Draw your calibration axis. Click Next, then OK to exit the calibration wizard.

Click OK to insert the calibration step in the script.

Select Tools>>Create LabVIEW VI to generate the LabVIEW code.

This functionality implements the LabVIEW code corresponding to the Vision Assistant script.

 

Hope this helps.

 

Christophe

 

 

0 Kudos
Message 2 of 5
(2,506 Views)

Hello @ChristopheC,

 

Your solution does not work in this case, because when you do the 'New Calibration' in the Vision Assistant and select the Edge Detect points, it creates an image calibration template with the information you entered and this is done just once, just when you click 'New Calibration'. Now if you run another similar image where the detected points by Edge Detect are different, your Calibration will not automatically update considering the position of these new points, this is what the person that posted the question wanted. When you convert to LabVIEW code, the problem continues, as LabVIEW just creates a constant with the pixel ratio information based on the calibration file, but never update these values if the detected points are different.

 

The solution, that I'm still working on (I have the same problem) is to create in LabVIEW a function that will, based on the points the user selects, write the Image Calibration Template (Like the button 'New Template'. And then, with this, it is easy in LabVIEW to read the calibration information from this template and use it.

 

I hope this explanation was clear.

 

Adrian

 

 


0 Kudos
Message 3 of 5
(2,057 Views)

Hello @adrianmazzola,

 

I have exactly the same need: programmatically writing the Image Calibration Template.

Could you post an example of your code please?

 

Clément

0 Kudos
Message 4 of 5
(1,870 Views)

Hello @csbareille,

 

At the end, I changed my approach, it will depend on the method you want to use (simple Point Distance or something more complicated).

 

If you just want a point distance calibration, at the end you are only doing a ratio pixel/millimeter. At this point I find it easier to simply ask the user the size of the identified line in millimeters and then, with the information of the distance in pixels, I write the ratio pixel/millimeter in a FGV and use it anywhere I want to convert the results (VI attached). In this approach, I don't use a calibration template and all the measurements are done in pixels.

 

If you want something more complicated, like a Distortion Model, there is no easy way to use the Calibration Training Interface inside LabVIEW , because they do not provide the source code.

But, what you can do, there is the solution that I implemented for my projet, is to invoke the Calibration Training Interface and pass images and parameters using command line arguments using the System Exec VI in LabVIEW.

You can find the documentation on how to call the Calibration Training interface in a command line in the help located here:

C:\Program Files (x86)\National Instruments\Vision\Utility\Calibration Training Interface\TrainCalibration.chm

 

Hope this helps you!

 

Adrian

0 Kudos
Message 5 of 5
(1,846 Views)