LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected Result when using IMAQ Find Edge 2

Solved!
Go to solution

We encountered a puzzling effect when using IMAQ Find Edge 2.

 

Screen.png

 

As you see in the image, all Edge Location points lie along one straight line while another straight is reported as the Result.

What could be the reason for such a behavior?

 

The VI and original image are attached.

Thank you.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
Download All
0 Kudos
Message 1 of 6
(311 Views)
Solution
Accepted by topic author _Y_

I think this is internal visualization issue, can be reported as bug to NI.

Technically the following happened. For each single search line the multiple falling edges are found, and they have different strength. You have selected "best", that means that the edge with highest strength will be used. It is quite simple to demonstrate in Visual Assistant.

I will setup edge detector at tame way, and get the same result:

Screenshot 2024-09-02 13.38.50.png

 

Now if you will switch to thew Advanced Tab, then you will see which Edge was used really:

Screenshot 2024-09-02 13.39.10.png

 

Just compare this with "First Edge" Option, now the line sitting on the edge:

Screenshot 2024-09-02 13.39.43.png

Because of this:

Screenshot 2024-09-02 13.40.03.png

 

If you would like to see detailed information in your VI, then you can use IMAQ Rake 3 with exactly same parameters used for IMAQ Find Edge 2:

Screenshot 2024-09-02 13.43.05.png

And now you will see real points used for fitting, this is why your result line moved to the left:

Screenshot 2024-09-02 13.44.37.png

Obvious solution is to use first edge instead of the best, for the first line the strength of the first edge is 16, (but sitting on the real edge), but the best is 20, but sitting somewhere on the structure behind the edge:

Screenshot 2024-09-02 13.47.58.png

First Edge:

Screenshot 2024-09-02 13.56.50.png

Message 2 of 6
(283 Views)

I have tested "IMAQ Find Straight Edges 4" on your image and it works like a charm without additional modification.

Note: I have the Vision Development Module 2023 Q1, which is why I have a more recent version of this VI.

However, the older function should work too.

 

Have you tried with Vision Assistant first? It usually helps you find good parameter values.

 

Also, your image seems a bit noisy and the texture of the object is quite random too. You should try pre-processing your image before detecting the edges, like converting to grayscale, removing the bright part on the right (the ideal being a white object on a black background), smoothening... then find straight edges. You could even threshold your image to binary and compute its convex hull in case you want to "repair" the edge dents, etc...

 

Regards,

Raphaël.

Message 3 of 6
(275 Views)

@raphschru wrote:

I have tested "IMAQ Find Straight Edges 4" on your image and it works like a charm without additional modification.


No, I don't think so. I have latest VDM and when exactly the same input values used, then exactly the same results are received:

Screenshot 2024-09-02 14.58.23.png

 

Screenshot 2024-09-02 14.58.35.png

I believe, the internal implementation uses the same edge detector in both cases.

0 Kudos
Message 4 of 6
(260 Views)

@Andrey_Dmitriev wrote:

@raphschru wrote:

I have tested "IMAQ Find Straight Edges 4" on your image and it works like a charm without additional modification.


No, I don't think so. I have latest VDM and when exactly the same input values used, then exactly the same results are received:


Ah you're right the results are the same with the same parameters.

However I had set "Edge Polarity" to "Rising Edge" (or "All Edges"), so that's why it worked.

 

raphschru_1-1725286783823.png

 

Regards,

Raphaël.

0 Kudos
Message 5 of 6
(234 Views)

@raphschru wrote:

@Andrey_Dmitriev wrote:

@raphschru wrote:

I have tested "IMAQ Find Straight Edges 4" on your image and it works like a charm without additional modification.


No, I don't think so. I have latest VDM and when exactly the same input values used, then exactly the same results are received:


Ah you're right the results are the same with the same parameters.

However I had set "Edge Polarity" to "Rising Edge" (or "All Edges"), so that's why it worked.

 

 

Regards,

Raphaël.


Yes, for sure, its depends from the structure. Rising edges are better in this particular case. As long as you have "Best Edge" there is always could be differences between yellow dots indicating first detected edge in search direction above the threshold and result.

Most simplest way to demonstrate is just step wedge:

Screenshot 2024-09-02 16.44.38.png

0 Kudos
Message 6 of 6
(225 Views)