Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create different colored ROIs using the ROI property node?

I want to write a set of Grouped ROIs to an IMAQ image using the ROI property node, and I want each of the ROIs to be a different color.  Is there a way to accomplish this?  After I write the ROIs, I want to let the user move them around if necessary, then read back the new positions using a read of the ROI property node.

 

I've tried using "IMAQ Overlay ROI" but it doesn't work because it apparently writes a different "type" of ROI - the ROIs it writes cannot be read back with ROI property node.

 

I've also tried using sequential writes to the property node, preceded by changing ROI Color.  This doesn't work because only the latest write remains in effect; previous ROI data is erased.

0 Kudos
Message 1 of 3
(4,817 Views)

Notice how the ROI color belongs to the image display control.  It does not belong to the ROI cluster.  This means there can only be a single ROI color at any given time on the image display.

 

To get around this limitation, you have to implement some pretty intense handling of ROI groups, and non-destructive overlays.  You will need to "capture" each new ROI that is drawn, and create a group and overlay for it.  Keep in mind that unless you create a new group, all of the geometric "contours" are part of a single ROI.

 

Making the overlays seem as if they can be edited will require you to make use of the mouse clik event, the "global rectangle" in each ROI group, and some way to use the mouse click coordinates to search for which global rectangle(s) was/were clicked on.  You would then recall that ROI groups cluster, and populate the property nodes with it, as well as the color.

 

I've done this type of handling on a couple of occasions, and it is not a trivial matter.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 3
(4,792 Views)

Thanks for your reply, John.  This is excellent, detailed info.  For now, I won't attempt it but it's good to know what's involved.  Perhaps NI will implement multi-colored ROIs in a future release!

0 Kudos
Message 3 of 3
(4,748 Views)