04-01-2022 02:19 AM
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?
04-01-2022 02:30 AM
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?
04-01-2022 02:39 AM - edited 04-01-2022 02:43 AM
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.