Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Labelling ROIs and calling them

I am dealing with multiple ROIs in a single image to perform different functions, sometimes of dependence to one another. How do I label each ROI and call them?
Does imaqLabel do this? How do I call the ROI after imaqLabel?
0 Kudos
Message 1 of 4
(3,480 Views)
Take a look at the online example program:
Multiple ROI Analysis in CVI:
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3EDFF56A4E034080020E74861&p_node=DZ52500&p_source=External

It is in CVI, but since I believe you are using C, this is more helpful to you than the LabVIEW version of the code. The function calls are very similar.

This code will show you how to label each ROI and call them. Below is a snippet of the labeling.

Hope this helps -
Julie S
Applications Engineer
National Instruments

MultipleROI = imaqCreateROI (); // Creates the ROI
MakeBoxes(MultipleROI); // Adds predefined boxes to image

imaqROIToMask (Mask, MultipleROI, 1, NULL, NULL); // Converts ROI to Mask image
// Labels the various Regions in the
Mask. Labelling these areas is required for
// imaqQuantify to report data for the various regions.

imaqLabel (Mask, Mask, FALSE, &NumOfRegions);
Message 2 of 4
(3,480 Views)
I've looked at the example before. My understanding is that it labels ROIs but it does not provide a way to call the ROIs after labeling. Am I wrong? I need to call individual ROIs to perform different functions. How can I do it? At first I was thinking of labeling them and calling it by their labels. But can imaqLabel provide for that?
0 Kudos
Message 3 of 4
(3,480 Views)
The example labels the regions, and then you can quantify the regions to get the border values. Then you know where the ROI lies, and you can call certain functions on that section of the image.

-Julie
0 Kudos
Message 4 of 4
(3,480 Views)