Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to obtain the coordinates of all points within a ROI, rather than just the ROI boundary coordinates?

For instance, when drawing a polygon ROI, the only values that IMAQ returns from the IMAQ WindLastEvent vi are the vertices of the polygon. I'm interested in getting all the points *within* the boundary. I'm looking for a way to do this for other complex shapes (e.g. annuli) as well.

Jon Marsh
jnm@soundlab.wustl.edu
0 Kudos
Message 1 of 3
(3,548 Views)
Jon,

I don't know of any direct method of doing this. There is a roundabout way to get the info, though.

You can use ROItoMask to create a binary image that represents the ROI. Then you could loop through the XY coordinates and check if the pixel is on or off. It really depends what your application is to figure out where to go from there.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 3
(3,548 Views)
Hi;
I guess it is fairly easy to do this. Creat a mask using your original image as a "model" and then your ROI (you will need to have another mask image to the IMAQ ROI to mask)

Then Threshold the image (considering the defualt value for the threshold in the above mentioned image is 255, this is easy), you will get a binary image. Now as Bruce said you can look at the pixel values or you van use Getpointsonthecontour.vi. This vi works only with binary images.

Also you can do some simple edge detection on your mask and then use the above vi.

Hope this helps
Hamid
0 Kudos
Message 3 of 3
(3,548 Views)