09-02-2024 04:28 AM
We encountered a puzzling effect when using IMAQ Find Edge 2.
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.
Solved! Go to Solution.
09-02-2024 06:52 AM - edited 09-02-2024 06:57 AM
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:
Now if you will switch to thew Advanced Tab, then you will see which Edge was used really:
Just compare this with "First Edge" Option, now the line sitting on the edge:
Because of this:
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:
And now you will see real points used for fitting, this is why your result line moved to the left:
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:
First Edge:
09-02-2024 07:29 AM
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.
09-02-2024 08:01 AM
@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:
I believe, the internal implementation uses the same edge detector in both cases.
09-02-2024 09:21 AM
@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.
09-02-2024 09:48 AM
@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: