LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Vertical distance- IMAQ clamp max Function

I need to find Vertical distance in an image-

 

First of all, I select a region using a rectangle box. Then i choose the scan direction : Left to right OR Top to Bottom.
For the Left to right scan direction, I use a IMAQ Clamp max function to calculate distance between the furthest opposite edges. It works fine when the measurement is done horizontal (See Figure 1).

 

Now I need to do the measurement in Vertical direction. i.e from top to bottom. I see that i cannot use the IMAQ Clamp max function since measurement is done horizontal in IMAQ Clamp Max. So i used a IMAQ Clamp Vertical Max VI to calculate distance in vertical direction. But now the problem is: If the image is a bit tilted, it gives a wrong result. (See Figure 2)

I also tried using IMAQ Clamp Vertical Min. But then it ignores the max point. If there is a variation ( bulge outwards or inwards) I need to have result depending on it.

Is there any ideas to correct the tilt?

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 1 of 6
(4,465 Views)

Hi Nghtcrwlr!

You can use the Max Clamp function with the setting "Vertical" in the Vision Assistant. Make sure that the ROI encloses the entire object in the image. The "Angle Range" parameter controls tolerance of the angle by which the edge can be rotated. If you set the parameter to a small value the algorithm will find the maximum dimension of the object along the vertical axis. However if you allow the algorithm to adapt to a slightly tilted image by setting the value to a higher value it will find the edges of the object and will determine the dimension perpendicular to those edges.

 

Hope that helps,

  Georg

Download All
0 Kudos
Message 2 of 6
(4,423 Views)

Hello georgJ

 

Actually I had tried using the Max Clamp function with the setting "Vertical" with higher angle value. It didnt work. Also I dont want to enclose the ROI  the entire object in the image. At times only a part of the image is to be measured. The image is not a uniform object. So covering the whole image ROI may give wrong result.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 6
(4,398 Views)

Also, in NI Vision Assitant you have the option in Clapm Parameters to select the Search Direction. But you dont have that in  NI Vision Development Module lvlib:IMAQ Clamp Max. Why is it that? Is there an option to choose the search direction in that function on LV``?

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 6
(4,392 Views)

Hi!

Maybe it would help to attach an actual image you want to measure to understand better how the algorithm is supposed to work.

The search direction of the MAX Clamp function is given by the rotation of the ROI. As an example I attached the ROI descriptor

for the MAX Clamp function, one time set with search direction horizontal and one time set to vertical.

Regards,

  Georg

Download All
Message 5 of 6
(4,363 Views)

Hi GeorgJ

 

Thanks for the explanation. Now I got a better idea. thanks a lot

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 6
(4,347 Views)