LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set different colors to different ROIs in one image

I'm building an application which can let users select muli-ROIs in one mage. In order to tell these ROIs, I need to either set different colors to different ROIs or label them (like ROI1 ROI2 ROI3). (I prefer label them but coloring will also do.) Could you show me how to achieve this? I have attached my code. My code can set muli-ROIs and display them but can't tell which one is which.

 

Thank you in advance.

0 Kudos
Message 1 of 8
(4,061 Views)

I think that you will need to convert the ROI's to overlays which you can color-code.  Look at the Overlay sub-pallet; IMAQ Overlay ROI might be a good place to start.

-cb

0 Kudos
Message 2 of 8
(4,055 Views)
1.PNG
0 Kudos
Message 3 of 8
(4,051 Views)

Hi,

 

Thank you for your input. However, by using overlay function it will destory the image, won't it? By the mean time, the image is updating at a video rate. So I'm looking for some methods other than Overlay ROIs or overlay text. The only purpose of the ROIs I'm using is to detect the pixel positions so that the application will use these positions to scan next image. Thanks.

0 Kudos
Message 4 of 8
(4,028 Views)

Hello,

 

The overlay function does not destroy the image. If you want the image to permanently have the ROI defined, you would have to use the Merge Overlay function before it would be added to the image. I believe this document will answer your questions about the overlay functions:http://digital.ni.com/public.nsf/allkb/D04C5EF569F1023686256F4100558E7F?OpenDocument

 

-Zach

0 Kudos
Message 5 of 8
(4,008 Views)

Hi Zach,

 

Thank you for your input. But if you use IMAQ Overlay ROIs, how can you remove a ROI once you set them? I use IMAQ Group ROIs to display all the ROIs I set and can simply remove any ones I don't want by delet the element of the ROIs array. 

 

Thanks

0 Kudos
Message 6 of 8
(4,001 Views)
You can use the IMAQ clear overly function to get rid of the overlays.  It gives you the option to remove groups of ROI's.  When you want to delete the overlay you can use that VI to remove the ROI.
Nick Keel
Product Manager - NI VeriStand and Model Interface Toolkit
National Instruments
0 Kudos
Message 7 of 8
(3,990 Views)

I am having a similar question as the gentle man who initiated this post.

However, I need to not only distinguish multiple ROIs on the image, but also extract subimages from those ROIs I set for analysis. Obviously overlay does not work for me, for I have to move ROIs around to find the spots, then extract the subimages.

 

Thanks a lot!

 

Xiang

0 Kudos
Message 8 of 8
(3,247 Views)