QR Code is widely used in our everyday life. As a two-dimensional barcode, it can store more data than 1D barcodes.There are many open-source and commercial libraries or SDKs which can read QR codes. A benchmark is needed to evaluate which one is more robust or suitable for a specific use case.
To know more go through this PDF or visit blog
https://www.dynamsoft.com/codepool/qr-code-reading-benchmark-and-comparison.html
2. What is QR code?
§ QR Code is a type of two-dimensional barcode
§ Consists of black squares arranged in a square grid on a white background
§ Stores more data than a 1D barcodes
§ QR Code has full (360 degrees) reading features
§ QR code has a finder pattern located in three of its corners
3. QR Code Reading Benchmark and Comparison
In the following slides we are going to run a benchmark based on an image data set to find out
the best QR Code reading SDKs.
4. Dataset
A comprehensive benchmark was made by the author of boofcv to compare boofcv with other
4 libraries
§ Performance test is made on the dataset to evaluate 5 open-source libraries
§ Dataset contains 536 images containing 1232 QR codes and has 16 categories
§ blurred
§ bright_spots
§ brightness
§ close
§ curved
§ damaged
§ glare
§ high_version
§ lots
§ monitor
§ nominal
§ noncompliane
§ pathological
§ perspective
§ rotations
§ shadows
5. Performance test tool
In order to run the benchmark, a performance test tool is written
§ The tool uses Python to run the test and provides a web interface. The Flask web
framework is used.
§ Code can be accessed here
§ It is going to run on a PC device with an Intel i5-10400 CPU and 16GB memory.
7. Evaluation metrics
Performance is evaluated by reading rate and runtime.
Reading rate can be achieved by dividing detected QR codes by total QR codes in images
If the value of IoU (Intersection over Union) between the detected QR code’s polygon and the
ground truth’s is over 0, then the QR code is considered detected.
Reading rate = Detected QR codes / Total QR codes
*More details about evaluation metrics can be found here
10. Detection results
Dynamsoft Barcode Reader ranks 1st in most of the categories. It ranks 2nd in the noncompliant and
perspective categories and 4th in the lots category.
Reading rate in percent
11. Detection results
Runtime per image (in milliseconds):
Runtime Results
Engine Result
DBR 141.10
Commercial SDK A 314.04
Commercial SDK B 48.31
Zxing 181.68
Zbar 199.26
BoofCV 205.48
OpenCV Wechat 175.06
14. Detection results
Although Commercial SDK B has low reading rate on the dataset, it is the fastest. The Dynamsoft
Barcode Reader ranks second on average.
15. Update Runtime Settings to Improve the Results
§ The benchmark is done without updating the SDKs’ default settings, which can
be updated to improve the reading accuracy or speed
§ Dynamsoft Barcode Reader provides rich parameters that users can customize
and optimize for different usage scenarios for the best scanning performance
§ The runtime settings of DBR can be represented and modified using a JSON
template
*Learn more about parameters of DBR here
16. Modify the Template to Decode the Lots Category
§ Reason - QR codes are relatively small and the
image has a large resolution (3024x4032) while in
DBR’s template, there is
a ScaleDownThreshold parameter which is set
to 2300 so that the image will be scaled down for a
better decoding speed.
§ If we set the ScaleDownThreshold to 99999, we can
decode all the QR codes
§ The reading rate for the lots category can increase
from 60.48 to 100 using the modified template
There are several files in the lots category that DBR cannot detect all the QR codes
17. Modify the Template to Decode the Blurred Category
§ For blurred QR codes as below, GRAY_SMOOTH image processing method can be used before deblurring
to decode it
§ If the QR codes are blurred too much, not much can be done
§ DBR can only decode one extra image after using the modified template in the blurred category. However,
SDKs like the Dynamsoft Camera Enhancer can help filter the blurred image
DBR comes with many image processing algorithms
18. Conclusion
§ The Dynamsoft Barcode Reader has the best QR code reading accuracy on the test set
§ DBR speed is good and has rich runtime settings to adapt to different scenarios
§ If conditions allow, it is better to choose DBR as the barcode reading SDK