Read Inverted Barcodes
Typically, barcodes are dark on a light background. But in some cases, the barcodes are “inverted” – light barcodes on a dark background, as shown in the image below.
Inverted Barcodes
The feature to decode such inverted barcodes is not enabled by default. To control this feature, we must use the GrayscaleTransformationModes
. Now for a quick breakdown of each of the modes:
- With only
GTM_ORIGINAL
enabled inGrayscaleTransformationModes
, DBR scans only general black-on-white barcodes. - With only
GTM_INVERTED
enabled inGrayscaleTransformationModes
, DBR scans only inverted barcodes. - When
GTM_ORIGINAL
is enabled as the first mode andGTM_INVERTED
is enabled as the second mode inGrayscaleTransformationModes
, DBR will try to decode general barcodes first. If the count of decoded barcodes does not reach the expected number, DBR will then try decoding the inverted barcodes.
Example
Below is an example illustrating how to configure the parameter GrayscaleTransformationModes
.
-
Update parameter
GrayscaleTransformationModes
in your JSON template{ "CaptureVisionTemplates": [ { "Name": "CV_0", "ImageROIProcessingNameArray": ["TA_0" ] } ], "TargetROIDefOptions" : [ { "Name": "TA_0", "TaskSettingNameArray": [ "BR_0" ] } ], "BarcodeReaderTaskSettingOptions": [ { "Name" : "BR_0", "SectionImageParameterArray": [ { "Section": "ST_REGION_PREDETECTION", "ImageParameterName": "IP_0" }, { "Section": "ST_BARCODE_LOCALIZATION", "ImageParameterName": "IP_0" }, { "Section": "ST_BARCODE_DECODING", "ImageParameterName": "IP_0" } ] } ], "ImageParameterOptions": [ { "Name": "IP_0", "GrayscaleTransformationModes": [ { "Mode": "GTM_ORIGINAL" }, { "Mode": "GTM_INVERTED" } ] } ] }
-
Apply the above settings following the article Use Templates for Configuring Parameters.