Issue:
When it comes to scanning hundreds of barcodes in an image, Dynamsoft offers many optimization settings to effectively and quickly batch scan QR Codes.
Solution:
First, set the barcode type to QR code if your image only contains this type of code to reduce decoding time. Next, set the ImagePreprocessingModes to eliminate blurriness and set the ThresholdCompensation in BinarizationModes higher to improve the binary image with a dark background. Then, try different localization methods to accurately pinpoint the barcode locations. At last, set the ExpectedBarcodesCount to a large number such as 999 to make sure that the algorithm works really hard to decode as many barcodes as possible.
JSON Template:
{
"ImageParameter" : {
"BinarizationModes": [
{
"BlockSizeX": 0,
"BlockSizeY": 0,
"EnableFillBinaryVacancy": 1,
"ImagePreprocessingModesIndex": -1,
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "BM_LOCAL_BLOCK",
"ThresholdCompensation": 20
}
],
"LocalizationModes": [
{
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "LM_CONNECTED_BLOCKS"
},
{
"IsOneDStacked": 0,
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "LM_SCAN_DIRECTLY",
"ScanDirection": 0,
"ScanStride": 0
},
{
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "LM_STATISTICS"
},
{
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "LM_LINES"
}
],
"BarcodeFormatIds": [
"BF_QR_CODE",
"BF_MICRO_QR"
],
"ExpectedBarcodesCount": 999,
"ImagePreprocessingModes": [
{
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "IPM_GENERAL"
},
{
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "IPM_GRAY_EQUALIZE",
"Sensitivity": 5
},
{
"LibraryFileName": "",
"LibraryParameters": "",
"Mode": "IPM_GRAY_SMOOTH",
"SmoothBlockSizeX": 3,
"SmoothBlockSizeY": 3
}
],
"Name": "Settings"
},
"Version" : "3.0"
}
Binarized image produced by Dynamsoft Barcode Reader:
Template for Dynamsoft Barcode Reader:
JavaScript Code Snippet to Use the Template:
barcodeReader.initRuntimeSettingsWithString(template);