Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Customized region of interest

I want to be able to draw a ROI using the cursor. Right now Region of Interest only has these following options: point ,line, rectangle, oval and magic wand. Nothing that would let me draw using the cursor. How can I do that?

0 Kudos
Message 1 of 6
(2,782 Views)

I want to be able to do this in NI Vision Builder AI.

0 Kudos
Message 2 of 6
(2,767 Views)

Ping

0 Kudos
Message 3 of 6
(2,714 Views)

Hi Kaivan,

 

I'm not sure this is something you can do with VBAI. Potentially you may be able to write a LabVIEW VI or custom step to provide this functionality, but I'll need to conduct further research. Why can't you use the options already available to you?

 

Thanks,

 

Peter George

Applications Engineer

National Instruments

0 Kudos
Message 4 of 6
(2,705 Views)

Yea I have been trying to make it possible in VBAI but in vain. We are supposed to do it without LabVIEW AI and so I have not looked into that prospect.

Also, I need to create a polygon type region of interest and none of the available options provide that. 

0 Kudos
Message 5 of 6
(2,697 Views)

The way to do that in the current version of VBAI is with a combination of custom UI and Run LabVIEW, but you need LabVIEW to be able to implement that feature.

 

1) Using LabVIEW, create a custom UI where you drop an image display control.

You can configure it to show only the ROI tools you want to support (select the ROI tool cluster, right click then select Visible Items>>ROI Tool Button Visibility.

Then create an 1D array *control* of I32s that will hold the coordinates of your polygon.

On the diagram, create a property node for the ROI, then unbundle it and extract the first contour and the points for this contour. Create a local variable for the array control, and set that variable to the points from the ROI Descriptor.

 

2) Create a second VI that you'll call from the Run LabVIEW step that will take an array as an input and return a ROI Descriptor.

Build the Polygon ROI from the array of points.

 

3) Configure VBAI to use the custom UI you defined in 1. Insert an Update Inspection UI step and make sure to Run the VI after updating indicators. This will ensure the array is populated with the ROI that the user can draw.

 

4) Add the Run LabVIEW step calling the VI you created in 2).

Set the input arrat to the User Interface Array value.

The ROI returned by the Run LabVIEW step will be visible in all the other steps that use ROIs, assuming those steps take a polygon type ROI.

 

Sorry there is no easier way to do it for now.

 

I hope this helps. Let me know if you need an example that shows how to do what I described above.

 

Christophe

 

Message 6 of 6
(2,691 Views)