tags:

views:

11133

answers:

3

Based on the stackoverflow question titled "Barcode- and Character Recognition component for .Net" we've discovered open source libraries for character recognition, but nothing's turned up for barcode recognition.

Does anyone know of an open source .NET barcode reader library?

EDIT: I'm asking for a library that can translate barcodes found on image files into text (not software that interfaces with hardware barcode readers)

A: 

You could try this one: http://sourceforge.net/projects/barbara/

Geoffrey Chetwood
not a lot there! Nothing which looks like it could be useful
paul
+7  A: 

See the CodeProject article: Reading Barcodes from an Image - II.

The author (James) improves (and credits) a previously written VB library to decode barcodes from an image using only .NET code.

There are two projects in the downloadable solution:

  • The barcode library - written in C#
  • The test app - written in VB

I have successfully used the C# code in VS2008 against a JPG image with an extended (includes alpha chars) code 39 barcode.

The library has the ability to scan an entire image for a barcode, where the barcode is only a portion. This has good and bad points. It is more flexible, but you may have to parse out noise. Of course, you will want to start with the cleanest image possible. Also, the scanned barcode must be fairly straight, not rotated or skewed at an angle.

If you can limit the scan to a "slice" of the actual barcode, you might get better accuracy.

In the article comments, another user submits a function that re-scans the barcode and uses a checksum digit, which is great if you control the printing of the original barcode and can include the checksum in the first place.

There are, of course some very impressive (and some very expensive) commercial solutions that have the advantage of being well-tested, more flexible, can scan more barcode formats, and are more tolerant of image quality due to improved image sampling. But this is a good (free) start!

You will need to sign up with CodeProject to download the code, but that is free also - and worth the time because there is so much good code on that site!

UPDATE: Incidentally, I just looked at the blog that Joachim Kerschbaumer mentions in another answer to this question. Definitely keep an eye on that project! It looks like a very robust solution. If it can read those skewed barcodes from those busy images, then it can do anything!

Doug L.
+1  A: 

The zxing library is primarily Java-based, but, does contain a reasonably recent port of most of the core code to C#. This should indeed solve the problem of finding barcodes in an image and decoding them -- if you are thining of QR Codes or 1D formats.

Sean Owen