Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

descriptors for multiple ROI's

Hi everyone, I was using "Ctrl" to put multiple ROI's on the image but the descriptor out is always the first one. Can somebody tell me a way to get the descriptors for all the ROI's? 
 
Thanks,
 
Carol
0 Kudos
Message 1 of 16
(6,824 Views)
It is actually all of them.  Each individual ROI is a contour in the ROI descriptor.



Randall Pursley
0 Kudos
Message 2 of 16
(6,822 Views)
Carol -

Just to be clear, in this case there is only one ROI which contains multiple contours.

If you're using LabVIEW, you can use IMAQ Ungroup ROIs to get an array of ROIs, each one containing one contour.  If you're using CVI, you can get the number of contours with imaqGetContourCount() and you can get each contour with imaqGetContourInfo2().  If you're using VB/.NET, the CWIMAQViewer.Regions property is a collection of CWIMAQRegion objects (which correspond to contours).

Hope that helps!

Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 3 of 16
(6,823 Views)

Thanks for the useful replies.

I am using Labview. So I used the Ungroup ROI's VI as suggested and now I get seperate descriptors out, which is great. I am wondering how I can use these descriptors... say for example, if I want to feed the first descriptor into the ROIProfile function, how I could do that?  This may be a simple question but I am fairly new to Labview, so help would be greatly appreciated..!

 

0 Kudos
Message 4 of 16
(6,811 Views)
Carol -

Since Ungroup ROIs returns an array of descriptors, you should be able to access each element of the array (by wiring it up to a While or For structure, or by using Index Array) and pass the element directly in to ROI Profile.

I'm on the way out of the office now, so let me know if this isn't clear 🙂

Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
Message 5 of 16
(6,809 Views)
Thanks. I will try that.
0 Kudos
Message 6 of 16
(6,808 Views)
Yes, it works. I just put an cluster unboundle and an ArraytoCluster VI . But I ran into this error when I tried to run the program. Any ideas? Thanks.
 
 
error -1074395720 IMAQ ROIProfile , Invalid ROI
 
 
 
 
 
 
 
Message 7 of 16
(6,782 Views)
Carol -

I'm guessing that "breaking apart" the ROI is causing the problem.  If you just call IMAQ Ungroup ROIs and wire the first element of the output array to the ROI Profile, do you still get the error?

If so, post that VI and I'll take a look at it.

Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
Message 8 of 16
(6,779 Views)
Hi, the entire VI is too large and complicated, so I just put the relevant parts here; if you need the entire file, I can upload it too.
 
Basically I tried two methods to get the seperate ROI array and feed it to ROIProfile. Both returned the error.
Message 9 of 16
(6,776 Views)
Why cant you use a imaq extract function.But DO remember to assign indiviudual buffer for how many ever roi you need.Should solve the problem right?
Message 10 of 16
(6,761 Views)