Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

ROI types in VB

Hello!

I'd like to now if is possible to use other types of ROI except only Rectangle. I'd like to use also circle.

Regards!
0 Kudos
Message 1 of 4
(3,696 Views)
Hi danilo,

Yes, it is possible to use different shapes as Regions of Interest.  In Vision Builder for Automated Inspection (VBAI), you can select Inspection Steps: Locate Features. You can select the Find Circular Edge step.  If you select a Find Straight Edge step, you will have three options added at the toolbar at the top of the screen.  From left to right the are, rectagular ROI, rotated ROI, and an annulus ROI.  The latter can be used to find a line that is moving as a radius of a circle.
Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 2 of 4
(3,680 Views)
Hello!

OK. But how can I extract RGB picture with circle ROI. Until now I have used command
CWIMAQVision.Extract2  which allows only rectangle?

Regards!
0 Kudos
Message 3 of 4
(3,664 Views)
Hi danilo,

The Extract2 method is specifically defined to reduce the image to a specified rectangle based on inputs for width and height.  If you want to have a circular image, I would suggest the following.  First off, you should note that you can't create a non-rectangular image.  However, you can create a mask of any shape, and set all pixels that are not in the mask to a particular value (white or black, most likely).  I would suggest using the Mask method of the CWIMAQVision object to mask the image using a circle.  You can then use the FillImage2 method of the same object to fill in everything not in the mask to a value of black or white (or whatever you choose). 

For future reference, you can find the IMAQ and Vision function help on your computer.  If you go to Start»Programs»National Instruments»Vision»Documentation»NI Vision you can open the file called cwimaq.chm.  Likewise for IMAQ, you can find the function help under Start»Programs»National Instruments»Vision»Documentation»NI-IMAQ called NIIMAQFunctionReference.chm.

Wes Pierce
Principal Engineer
Pierce Controls
0 Kudos
Message 4 of 4
(3,647 Views)