Chapter 4. Developer Tip: Improve Barcode Recognition Rates

Chapter 4. Developer Tip: Improve Barcode Recognition Rates

Developer Tip: Improve Barcode Recognition Rates

In the fast-paced world of software development, improving the accuracy and speed of barcode recognition is a crucial challenge for developers. This blog explores 4 essential tips and techniques that can help enhance barcode scanning capabilities. Learn about resolutions, dealing with damaged barcodes, and pre-processing techniques such as dilation and binarization. Gain valuable insights into optimizing barcode scanning experiences by discovering how to deskew barcodes and improve recognition rates based on scan distance.

By implementing these strategies, developers can improve their barcode scanning accuracy and efficiency.

Resolution

The quality of the barcode image produced by your chosen barcode generator matters. Generally, a barcode reader processes the counting of pixels in an area to determine the width and location of a particular bar in a barcode symbol. So, a lack of resolution can interfere with this process. Usually, a minimum of 200 dpi is needed for acceptable barcode scanning. The higher you can go in resolution, the better.

Most organizations will seek to balance good barcode recognition with storage savings realized by minimizing resolution. Just be sure not to sacrifice barcode reading efficiencies for storage efficiencies. Remember that the lower the resolution, the more likely the symbol will lack the pixel density needed for good recognition.

Generally, for 1D barcodes, it’s understood that at least three pixels are needed per smallest bar and gap in a symbol. For 2D barcodes, it’s usually around five pixels. Sometimes, despite proper resolution settings, good pixel density just isn’t there. This could be for many reasons – poor quality labels, printers, etc.

16-module width

Dealing with Unreadable or Damaged Barcodes

Barcode readers are only as good as the software behind them at scanning low-quality barcodes or damaged barcodes. There are 3 pre-processing techniques to apply to enhance the barcode quality and improve the decoding rate.

17-damaged barcodes

Dilation — adds pixels to the boundaries of objects in an image, while erosion removes pixels on an object’s boundaries. 8-dilation

Binarization — converts images to black and white leaving only two levels, allowing for an easier distinction between the edges of images. 10-binarization

Despeckle — considers the average of pixels in an area to try and detect whether a pixel is a color it should be or if it is noise created during image acquisition.

11-despeckle

Deskew A Barcode

To deskew a barcode means to essentially straighten it out. When a barcode is skewed, depending on the angle and how skewed it is, the individual lines of a barcode can appear thicker or thinner than normal. So, when de-skewing occurs, it can actually worsen things.

Also, deskewing almost always reduces the image quality, which can result in reduced barcode recognition accuracy. As with all other obstacles mentioned, you can use the pre-processing features of an SDK to auto-deskew barcodes while maximizing their recognition accuracy. Regardless, having to deskew adds time and reduces speed.

9-deskew

Scan Distance

For 1D barcodes, scan distance is important as it can impact barcode recognition in that you may scan unwanted pixels. For example, the number “1” on a page, whether part of a text in a sentence or part of a barcode symbol, may be confused for a bar depending on its location and the scan distance. Thus, it is ideal to set a scan distance of five pixels or more for optimal decoding speed and accuracy.

Generally, the higher the scan distance you can set (more than five), the faster it will become. The barcode reader’s viewing angle can also impact the required distance and the reader type you will need. Laser scanners are generally better at reading at distances more than two feet, such as compared to smartphones. They are also generally better in low-light situations. With effective pre-processing built into good software, damaged or hard-to-read barcodes can quickly be corrected during scanning to improve recognition rates.

free online document scan


This post is a part of the series: Best Practices for Maximizing Barcode Reader Technology.

Chapter 01 Where are barcodes used

Chapter 02 Character set encoded in barcodes

Chapter 03 Barcode scanning algorithm: localization and decode

Chapter 04 Developer tip: improve barcode recognition rates

Chapter 05 Developer tip: improve barcode recognition speed

Chapter 06 Technical considerations when choosing a barcode SDK