Chapter 5. Developer tip: improve barcode recognition speed
Developer Tip: Improve Barcode Recognition Speed
The location of the barcode involves where it is physically located on a page, box or other items. It’s important to consider user scenarios because location identification can increase recognition speed. Also, you want to consider the location to ensure its placement isn’t going to be where it’s likely to become damaged. For example, if you’re placing it on a printed health record, you probably want to avoid putting the barcode where users commonly staple another item with the barcoded item. If you can specify a quadrant or area as to where the barcode will always be, this can also improve speed. For example, if you know barcodes will always be in a three-inch by three-inch box at the top right corner of an 8.5” x 11” page, with good software you can instruct the software to read only that area. Thus, time isn’t wasted scanning other parts of the page where barcodes are not present.
Part of having success in barcode scans is having a properly defined quiet zone. A quiet zone is a blank area or margin on either end of a barcode. That blank area tells a barcode scanner where the barcode starts and stops. Quiet zone specifications vary depending on the barcode symbol being used. Usually, at least an eighth of an inch is a minimal requirement. However, it’s important to verify quiet zone requirements for any chosen barcode. Be sure the location where you’ll place the barcode allows for required quiet zones.
Barcode Direction and Rotation
As you can imagine, specifying the direction your barcodes will be in when decoded can increase speed. This is because the software doesn’t have to account for multiple orientations to look for. For example, if you can specify in your application that barcode orientations will always be horizontal, as opposed to vertical, speed will be nominally improved. For further orientation-related speed improvements, you’ll want to avoid as much as possible having to pre-process a barcode. While sometimes unavoidable, this means not having to de-skew it or perhaps smooth it.
Another related process that can impact decoding speed is when you must smooth a barcode. This essentially adds resolution and darkens damaged barcodes that are heavily faded and lacking pixel density. But this isn’t just about duplicating pixels to darken it since this can negatively impact barcode recognition.
Smoothing a barcode that is lacking contrast or pixel density must be done intelligently and an appropriate zoom level should be employed in the barcode reader software. So, you can imagine that whenever smoothing is implemented, speed is sacrificed. Just as you want to avoid deskewing, you’ll want to avoid smoothing too. There are cases where fixing damaged barcodes are unavoidable parts of an operation for a specific application. In such cases, being able to pre-process barcodes will help speed operations. But, in most cases, avoiding pre-processing mechanisms is an ideal path to speedier decoding.
Barcodes Per Page
Your barcode reader software should allow for parameters that define how many barcodes on a page will be scanned or how many pages need scanning per document. For example, let’s say you have a five-page document with two barcodes and the barcodes are on page two and three. Being able to specify in your software how many barcodes are expected and on what pages can dramatically improve speed. The speed benefits are compounded as the number of documents you have grows. So, you should be able to make the software scan only for a set number of barcodes or for particular pages. You can also set this on a per page-basis, such as if the barcodes scanned in a page has hit the maximum number of barcodes allowed.
Multi-threading refers to running more than one thread of execution for a task (a program, or a process) within an operating system. Each request for the task is kept track of as a thread with a separate identity. The requests are processed in parallel in multi-cores or multiprocessors. Given that multi-core CPUs are so common now, it’s important for a software application to process information in an asynchronous fashion. This way, a piece of software can use multithreading to speed things up without wasting your processor’s computing capability.
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