LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coordinates of found edge, outside of image boundary?

Hi All,

 

I am trying to write a "corner detection" VI for a vision application I am developing. My technique is as follows:

 

1. (Vision Assistant Generated Code) find a single straight edge (using Find Straight Edges 3), searching left-to-right

2. (Manually created code) create a region of interest from that line's coordinates (using Line to ROI)

3.  (Vision Assistant Generated Code) Use Region of Interest as input into a second "Find Straight Edges 3", this time searching top-to-bottom

4. (Manual) create a region of interest from the second line's coordinates, which may contain a "corner".

 

However, the Region of Interest generated in Step 2 is consistently bounded by pixels which are outside of the size of the image. This results in an "Invalid ROI" Error (-1074395720) in Step 3, and an empty image is produced.

 

Why should this occur? Please let me know if you need more information, and I will gladly provide it!

0 Kudos
Message 1 of 4
(2,527 Views)

Hi Aiyer,

 

What 'Type' do you have selected in the ROI Descriptor?  This error can occur if the function you are using expects a certain type of ROI and it is being given one that is incompatible.  For the IMAQ Find Straight Edges 3 VI it looks like it requires a rectangle or rotated rectangle.  

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 2 of 4
(2,504 Views)

Hi Cole,

 

The output of Line to ROI seems to make an ROI of type "line", so I tried manually building an ROI of type "Rotated Rectangle" and that did not solve the problem. I was using the pixel location output of "Find Straight Edges 3" to build that ROI (for the location of both the "Global Rectangle" and the "external" bounds of the ROI).

 

What I am currently implementing is using the output of "Line to ROI" and replacing the type with "Rotated Rectangle". I will have a chance to test this tomorrow.

 

In any case, do you know why the pixel locations for the (X,Y) coordinates of the line are greater than the boundaries of the image? I am considering writing a VI which determines coordinates which are inside the bounds, and along the found line, but I would prefer to just use the prescribed VIs.

 

0 Kudos
Message 3 of 4
(2,498 Views)

It would help if we could get some screenshots of the code that you are creating.  Since we are having some difficulty with the ROIs take a look at this ROI Descriptor Example.  It clearly shows what all the regions of interest look like.  I hope it helps!

 

http://zone.ni.com/devzone/cda/epd/p/id/5249

Cole R.
National Instruments
Software Engineer
0 Kudos
Message 4 of 4
(2,488 Views)