LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ROI of IMAQ Read Barcode 2 VI

I use "IMAQ Read Barcode 2 Vi" to do bar code recognization, and only a patr of image is valid, so I use ROI to mark the valid image region to the sub-vi. However, my ROI is not a rectangle, on the contrary, only the outside of rectangle is valid, so I set the ROI descriptor as blow:

 

Global Rectangle:  0, 0, 1280, 720

Contoures: 

       ID:       internal

       Type:   Rectangle

       coordinates: 100, 100, 800, 600.

 

I just took use of the parameter to define a big rectangle as ROI, excluding the small rectangle inside.

but the barcodes vi can't follow this ROI, it always use the small rectangle as ROI.

 

Can the barcode-vi use a rectangle with a hole as ROI? how to define this ROI?

 
0 Kudos
Message 1 of 3
(600 Views)

I use "IMAQ Read Barcode 2 Vi" to do bar code recognization, and only a patr of image is valid, so I use ROI to mark the valid image region to the sub-vi. However, my ROI is not a rectangle, on the contrary, only the outside of rectangle is valid, so I set the ROI descriptor as blow:

 

Global Rectangle:  0, 0, 1280, 720

Contoures: 

       ID:       internal

       Type:   Rectangle

       coordinates: 100, 100, 800, 600.

 

I just took use of the parameter to define a big rectangle as ROI, excluding the small rectangle inside.

but the barcodes vi can't follow this ROI, it always use the small rectangle as ROI.

 

Can the barcode-vi use a rectangle with a hole as ROI? how to define this ROI?

 
0 Kudos
Message 2 of 3
(599 Views)

The ROI control contains an array of contours. Try making one large contour containing your outer edge (ID = external) and one smaller rectangle with your inner edge (ID = internal) which is the area you want to exclude.

 

EDIT: the global rectangle is "the minimum rectangle required to contain all of the contours in the ROI". Set its size to the 1st contour with the outer edge.

0 Kudos
Message 3 of 3
(593 Views)