DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Top React Libraries for Data-Driven Dashboard App Development
  • OpenTelemetry Moves Past the Three Pillars
  • Using Barcodes in iText 7
  • DocRaptor vs. WeasyPrint: A PDF Export Showdown

Trending

  • Building Custom Tools With Model Context Protocol
  • Build Your First AI Model in Python: A Beginner's Guide (1 of 3)
  • Analyzing Techniques to Provision Access via IDAM Models During Emergency and Disaster Response
  • Non-Project Backlog Management for Software Engineering Teams
  1. DZone
  2. Popular
  3. Open Source
  4. New QR Code Reader Library

New QR Code Reader Library

Learn about a new, free QR code reader and associated library that improve performance and let you take advantage of QR for more innovative purposes.

By 
Peter Abeles user avatar
Peter Abeles
·
Apr. 03, 18 · Opinion
Likes (2)
Comment
Save
Tweet
Share
37.0K Views

Join the DZone community and get the full member experience.

Join For Free

This article discusses a new free QR Code detector that has been released as part of an existing open source computer vision library. Its features are highlighted and a performance study is shown, comparing it to several other open source libraries. It's shown to have the best overall performance and be one of the faster libraries.Image title

For the few of you who don't know, those weird markers you have been seeing printed on buisness cards, food, and shipping boxes, with three squares on them are QR Codes. They are used to encode data such as websites, e-mail addresses, and product information. Just take a photo of it with the correct application and you will get access to all that information or automatically taken to a website. In theory.

For years now, there have been several open source QR Code detectors or reader libraries to choose from. A software developer can add one of these libraries to their application then read the QR Codes using a camera. Probably the most popular library is ZXing, but there plenty of others to choose from. These libraries are typically designed to for the most common use case, which is detecting a single QR Code in nominal lighting conditions.

Recently a new QR Code detector was added to BoofCV, which leverages past development on markers for camera calibration and augmented reality. The main motivation behind the development of this new QR Code detector was to read numerous QR Codes in a single high-resolution image, in less than ideal lighting conditions, with high-accuracy corners, as fast as possible. In that, it was almost completely successful.

Features of BoofCV's QR Code Detector:

  • Fast detection

  • Works in poor lighting conditions

  • Barely slows with numerous markers in view at the same time

  • High Precision Corner

  • Access to internal data structures and likely false negatives

  • True rotation invariance

The main disadvantage of BoofCV's detector, relative to other libraries, is that it doesn't handle damaged locator patterns very well. Locator patterns are the squares within a square. Most detectors use some variant of the baseline algorithm described in the QR Code specification. BoofCV uses a technique designed for AR markers. This makes it invariant to rotation, but doesn't like it when the squares are scratched. Scratches/damage inside the data region are just fine and easily recovered from. 

To test this new detector's capabilities, a performance benchmark has been created from 230  images (and counting). These images are carefully selected to stress test it in many different environments and situations. A sample of the types of images included is shown below.

Sample Images From Different Categories

This same benchmark has been applied to ZXing, Quirc, and ZBar libraries! Those are all the open source libraries that I'm aware of. When possible, each of the libraries was tuned to detect QR Codes robustly. Results are shown below for detection under several different categories. F-Measure is the performance metric. A value of 1 means perfect performance and 0 means it failed to detect anything.

Detection Performance by Category

One thing to take away from this chart is that there's no clear winner across every category, but there are libraries which clearly do better overall. BoofCV's new detector does very well in situations that it was designed for. The benchmark is freely available, too, and can be found here in the third-party directory. More images are being added to it on a regular basis. You can help if you have access to images from a factory environment by sending them over.

What about speed? This benchmark wasn't designed to evaluate how fast individual libraries run. It does keep track of total compute time, which includes reading the images and saving the output. I was hesitant in including those results, but decided that the conclusion was unlikely to change as a result of more careful analysis.

Library

Processing Time Seconds
(Lower the Better)

Quirc 37.4
BoofCV 41.6
ZXing 78.3
ZBar 115.4

The two fastest libraries are clearly Quirc and BoofCV, while BoofCV does much better than Quirc in most categories. In some cases, like with ZXing, a library can be tuned to run faster at the sacrifice of being able to detect QR Codes robustly. If there's interest, I'll do a follow-up article which will go into much more detail about how tuning affects performance in each library and goes into a greater discussion of how the results are found.

Head on over to http://boofcv.org if you want to check out the new detector. Feel free to post questions below, too! It's easy to run on any desktop computer (Windows, Mac OS X, Linux) and Android.

QR code Library Open source

Opinions expressed by DZone contributors are their own.

Related

  • Top React Libraries for Data-Driven Dashboard App Development
  • OpenTelemetry Moves Past the Three Pillars
  • Using Barcodes in iText 7
  • DocRaptor vs. WeasyPrint: A PDF Export Showdown

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: