Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does my IMAQ Find Circular Edge tool give a result in pixels instead of um when I migrate from Vision Assistant to a VI?

I have a very simple script in vision assitant.  I open a picture I have previously saved that just has a light circle on a dark background.  I have previously taken a picture of a grid of dots that has yielded calibration info in micrometers.

In Vision Assistant, my steps are:

Orignal Image--->Image Calibration 1--->Circular Edge (Spoke)1

This works, and gives me a result of the center x and y of the circle in pixels, the current radius in micrometers, and current deviation in pixels.


From Vision Assistant, I used the Create LabView VI tool to make a Labview VI of this very simple process.
However, on the front panel of the VI, it returns the Best Circle Center X-Y and Radius in pixels.
I have found no option to change this.

I'll upload a screenshot of the reults in Vision Assistant and on the LabView front panel to show this.  As soon as I get them onto a server.


0 Kudos
Message 1 of 9
(5,161 Views)
Just posting pics.

Here is the result in NI Vision Assitant:


Here is the result in the Labview VI Front Panel--notice the center is the same, as the measurements are in pixels, but the radius is now 61.55, which is pixels, not micrometers.

0 Kudos
Message 2 of 9
(5,160 Views)

Hi,

In a effort to keep the code generated simple, the LabVIEW code generated by the shipping version of Vision Assistant does not compute calibrated results. The code only calls the Vision API VI that performs the function you inserted in the Vision Assistant script, that does not return calibrated results.

To compute the calibrated result, unbundle the center from the result and use the VI called "IMAQ Convert Pixel to Real World" located in the Vision Utilities>>Calibration palette. Make sure to connect the calibrated image.

The next version of Vision Assistant will create LabVIEW code that computes calibrated results.

In the same way, we do not generate the code to overlay results, like Vision Assistant does. In your specific case, the results will be overlaid because the API VI does it.

-Christophe

 

 

0 Kudos
Message 3 of 9
(5,142 Views)
Thanks a ton for your help--that seems like a pretty simple fix, even for a complete LabView n00b such as myself.
I'll post whether or not I am able to get that to work.
0 Kudos
Message 4 of 9
(5,135 Views)
It didn't work--it will convert the unbundled X-Y pixel coordinates to microns, but not the radius, which is what I want.

Here's what that section of the block diagram looked like beforehand:




Here's what it looks like when I have it display the Center X and Y in micrometers:


However, I can't connect the Radius (which is what I want converted into micrometers) to the IMAQ Convert Pixel to Real World, because the IMAQ Convert Pixel to Real World is design to convert coordinates (vectors), not measurements (scalars).

Here are shots of that attempted connection and the given error:




It doesn't look like any of the other VIs in that palette are designed to convert a distance, either.

Any suggestions?

0 Kudos
Message 5 of 9
(5,131 Views)
Hi,
 
The Convert Pixel to Real World VI only converts points in the image to their corresponding coordinates in real-world, based on the calibration and calibration axis info you defined.
To compute real-world distances, you need to compute the position in real-world of 2 points, then use an analytic geometry function to compute the distance.
In you case, I compute the position of a point located on the same axis, at radius distance from the center, convert both points to real-world, then compute the real-world radius using the IMAQ Point Distances VI. See attached VI written in LabVIEW 8.5.
Again, the next version of Vision Assistant will generate code that does that for you.
 
-Christophe
0 Kudos
Message 6 of 9
(5,127 Views)
Cool.

I was imagining there could be some sort of workaround by finding 2 points (I was thinking about clamping the edges of the found circle or something) but it was going to be a stretch with my skillset.  Your example code should make it work.
0 Kudos
Message 7 of 9
(5,125 Views)
Excellent!

It works now.

Thanks a ton.
0 Kudos
Message 8 of 9
(5,124 Views)
Dear SuperFly,

I created the same script in Vision Assistant, and then created a LabVIEW VI from this script. I observed the same behavior that you did: The radius was returned in my calibrated unit in Vision Assistant, but in pixels in LabVIEW.

Take a look at the post below. It explains that this problem is a noted oversight in the Vision Assistant, and gives the solution.

Troubles when creating LabVIEW VI from Vision Assistant

Best Regards,

~Nate
________________
NI Applications Engineering
0 Kudos
Message 9 of 9
(5,118 Views)