From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange problem with ROI and IMAQ Find Straight Edges 3

Solved!
Go to solution

So firstly, I notice that the ROI produced by the ROI functions seems to have an incompatibility with the input of IMAQ Find Straight Edges 3:

 

ROI_mismatch.png

 

In my code, I have the peculiar problem 'IMAQ Find Straight Edges 3' is producing edges that lie outwith the boundaries specifided by the wired ROI:

 

Edge_detect_issue.png

 

In this case I have an ROI defined by a rectangle, [476, 1559, 752, 1779] but the best fit line being produced by the VI lies outside of this rectangle (see y-coordinate of 1876).

 

How is this possible?

 

 

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

caleyjag a écrit :

In my code, I have the peculiar problem 'IMAQ Find Straight Edges 3' is producing edges that lie outwith the boundaries specifided by the wired ROI:

 

Edge_detect_issue.png

 

In this case I have an ROI defined by a rectangle, [476, 1559, 752, 1779] but the best fit line being produced by the VI lies outside of this rectangle (see y-coordinate of 1876).

 

How is this possible?

  


Well... maybe it is possible... can you show the image with the ROI displayed on it?

 

One question, if you change the ROI to make place it tight around the actual edge in the imaage, does it change the result you get?

I'm asking this because I've noticed with a certains version on Vision Development module that if the ROI is toot thight around the egde you're looking for the result you get will be slightly wrong.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

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

Here you go:

 

plunger.png

 

The ROIs are the two blue boxes to the right and left of the image.

 

We're looking at a rubber plunger in a glass syringe.

 

The yellow lines are the result from IMAQ Find Straight Edges 3, which is looking for a transition from bright to dark from left to right on the left box and right to left in the right box.

 

Both of them seem to be off by the same amount.

 

The ROIs were hand drawn (we're still in the dev stage) which is why they are slightly different sizes.

 

The contrast at the edge isn't great because of the context of the application, but nevertheless I don't think that is the problem here.

Message 3 of 5
(5,288 Views)

that is surprising... are any referencing or any calibration in your code?

can you post the raw png (without overlays)?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 4 of 5
(5,259 Views)
Solution
Accepted by topic author caleyjag

I finally figured it out - it was my fault. I was updating the global rectangle in the ROI input properly, but not the contours.

 

I fixed the wiring and now it works great.


Case closed!

 

-G

0 Kudos
Message 5 of 5
(5,250 Views)