Dev Center
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

Your download will start shortly. If your download does not begin, click here to retry.

How to Boost Barcode Reading Accuracy

There are 3 basic metrics for measuring the performance of a barcode reader application: speed, accuracy and read-rate. The Dynamsoft Barcode Reader SDK (DBR) has been carefully designed to have excellent performance in all three of these metrics. In this article, we try to investigate all the possible methods you can take to let DBR focus on accuracy.

As the ultimate guide on how to configure DBR to realize its full accuracy potential, we will start with some general methods that are both simple and effective, and then delve into some of the more niche or specific methods to achieve higher accuracy. Lastly, we’ll cover some external settings such as those of the Camera Enhancer SDK which can be useful in certain situations.

The following shows the definition of the three metrics.

$ Accuracy = \frac{Number~of~Correctly~Decoded~Barcode~Results}{Number~of~All~Decoded~Barcode~Results} $

$ Speed = \frac{Number~of~All~Decoded~Barcode~Results}{Total~Time~Consumed} $

$ Read~Rate = \frac{Number~of~All~Decoded~Barcode~Results}{Number~of~All~Target~Barcodes} $

Do bear in mind that if one of these metrics is prioritized, the other two may not be ideal.

General Settings

The following settings can be applied to nearly all usage scenarios to improve the barcode reading accuracy.

Filter the Result by Confidence

The confidence attribute of the barcode results is determined by the reliability of that result. Users can set the MinResultConfidence to make a filter on the barcode results by the confidence value. For Dynamsoft Barcode Reader v8.8 or later, the default value of the confidence is optimized to 30, which can filter out the majority of misread barcode results. A higher MinResultConfidence setting will definitely improve the accuracy of the barcode results but reduce the read rate and speed at the same time. Therefore, please set the MinResultConfidence according to your actual usage scenario to balance the accuracy, speed read rate.

Enable Multi-frame Verification

For interactive video scenarios, it is possible to receive duplicate results for a single barcode across multiple frames. By adding a CMultiFrameResultCrossFilter and enabling result cross-verification, the result is verified and output only if a certain barcode result appears twice or more within the past few frames. Otherwise, it is considered a misread result and discarded.

Specific Settings

When configuring the specific settings, you have to know some basic information about your usage scenario. This type of information will help exclude undesired barcode results or put a filter on the barcode results.

Specify the Barcode Formats

The barcode format specification is the most basic decode setting that affects all three metrics of the performance. Sometimes, misreading a 1D barcode is caused by misrecognizing the 1D barcode as another 1D barcode type. If the targeted 1D barcodes are scoped, you can specify the barcode format in your project to lower the probability of misread results.

The related parameters are BarcodeFormatIds .

Enable Result Text Filter

When the target barcodes are confirmed, the barcode texts might have common features that help you implement a result filter on the result text. Using the BarcodeFormatSpecification parameters, you can add barcode result text restrictions like regular expression requirements and text length range.

Exclude Small-Module Barcodes

The module size of the barcode refers to the pixel size of the barcode modules (e.g. the pixel width of a 1D barcode line or the smallest cell size of a QR code). The smaller the module size of the barcodes, the higher risk of a misread. If it is not necessary to decode all the small-size barcodes in the scenario, you can skip the small-module barcodes by specifying the minimum acceptable module size of the barcodes via parameter ModuleSizeRangeArray.

When processing large-size images, DBR scales down the images based on the ScaleDownThreshold before decoding. However, sometimes the barcode on the image might be shrunk too small. You can increase the scaleDownThreshold value to ensure the module size of the barcodes is big enough to get the correct barcode results.

Recommendation

By increasing the MinValue of the ModuleSizeRangeArray, the SDK can skip the small-module barcodes and their potential misreads, thus ensuring a higher accuracy. Increasing the value of ScaleDownThreshold can also potentially lead to better accuracy, while lowering it offers better speed.

Optimize DeblurModes Settings

DeblurModes is the parameter that controls how much effort DBR will spend in processing the located barcodes. It is set to the highest level by default so that DBR will try its best to process every localized barcode even if they are highly blurred. However, the blurriness of the barcodes and the accuracy of the barcode results are inversely proportional. As a result, when the read rate is high enough with the current settings, you can try to simplify the DeblurModes array to reduce the possibility of any misreads.

Generally, the simpler the DeblurModes array is, the higher the accuracy. As a result, when accuracy is prioritized, the aim is to find the simplest DeblurModes configuration that covers the requirements. To find the simplest configuration, it is recommended to approach this from a trial and error standpoint and continuously test each configuration. For this approach, you can start with the full DeblurModes array and incrementally reduce the enabled DeblurModes till the read rate is no longer acceptable.

Recommendation

Please note, DM_DEEP_ANALYSIS is the most effective, but most complicated, mode to process blurry barcodes and you can remove this mode first with this approach. DM_BASED_ON_LOC_BIN and DM_THRESHOLD_BINARIZATION are the most basic DeblurModes, and should be kept to retain the minimum barcode decoding capability.

External Settings – Camera Enhancer Settings

For the interactive video scenarios, promoting the quality of the video will definitely improve the barcode decoding accuracy. Although there is no camera control APIs within the Dynamsoft Barcode Reader API, Dynamsoft Camera Enhancer (DCE) APIs offer the ability to take control of the input video streaming. DCE is an SDK that integrates the camera control API and video frame pre-processing features. It can be easily bound to the Barcode Reader and enables users to optimize the input video streaming when using the Barcode Reader. The following DCE settings and functions can help improve the accuracy of barcode decoding:

Filter Out the Blurry Frames

When the frame filter feature of DCE is enabled, a quick sharpness evaluation will be implemented on each video frame - low sharpness frames will be discarded to ensure the barcode reader will process high-quality frames only. Since the Barcode Reader doesn’t need to process the blurry video frames, the accuracy will be highly improved.

Recommendation

The frame-filter feature of DCE can be enabled via the enableEnhancedFeatures method.

Enhance the Camera Focus

It is highly recommended that this feature be implemented on low-end devices. Enhancing the camera focus ability will reduce the blurry frames in the video streaming, which benefits the barcode reading accuracy.

Recommendation

To enable the enhanced-focus feature of DCE, please use enableEnhancedFeatures.

Set Higher Resolution

A higher resolution will promote the sharpness of the video frames and enlarge the module size of barcodes. Increasing the resolution will definitely benefit the barcode reading accuracy while sacrificing speed. In addition, please remember to set the MinValue of ScaleDownThreshold to a higher value if you want to decode on high-resolution video streaming. If the ScaleDownThershold is smaller than the size of video frames, the video frames will be shrunk to a smaller size before being decoded.

Recommendation

To configure the resolution, please use the setResolution method.

Define the Scan Region

Using DCE, you can specify the scan region so that the SDK only works with a specific area of the image or frame. The video frames will be cropped before barcode decoding so that the barcode reader will ignore the areas that are of no interest to the decoding process, thus resulting in faster and more accurate results.

Recommendation

You can specify the scan region via the DCE method setScanRegion.

Summary

In this article, we explored the accuracy-friendly settings. In summary, the methods that improve the accuracy can be categorized as follows:

  • Enhance the image/video source before decoding
  • Exclude the areas of the image or frame that are not related to the barcode when decoding
  • Filter out the incorrect results after decoding

Some of the accuracy-friendly settings may benefit the speed or read rate at the same time. For example, when the non-supported barcode formats are excluded, both the processing speed and the accuracy are improved. Hardly does this setting affect the read rate metric. However, some other accuracy-friendly settings, for example, the confidence filter (increasing the MinResultConfidence), may worsen both the processing speed and read rate. To adjust the parameter setting to fit your usage scenario, you might need to find the balance between the 3 dimensions of performance.

The following links are the article that explains how to make settings when either speed or read rate is prioritized. Reading the articles will help you further understand the parameter settings and measure how to configure the setting for your own project.

If you are not sure where to start regarding which dimension of the performance should be prioritized or you are still puzzled by the parameter settings, please feel free to contact us to get support from our technical support team. Our team can give you professional suggestions on the parameter settings that best fulfill your requirements.

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.33
    • Version 9.6.32
    • Version 9.6.31
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +