See CodeProject: Reading Barcodes from an Image - II .
The author ( James ) improves (and gets) the previously written VB library for decoding barcodes from an image using only .NET code.
There are two projects in the downloadable solution:
- Barcode Library - written in C #
- Test Application written in VB
I have successfully used C # code in VS2008 against a JPG image with an extended (including alphabetic character) 39 barcode code.
The library has the ability to scan the entire image for a barcode, where the barcode is only part. It has good and bad points. It is more flexible, but you may have to make out the noise. Of course, you will want to start with the cleanest image. In addition, the scanned barcode must be straight enough, not rotated or distorted at an angle.
If you can limit the scan to a โsliceโ of the actual barcode, you can get more accurate accuracy.
In the comments to the article, another user sends a function that scans the barcode again and uses the checksum digit, which is great if you control the printing of the original barcode and you 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 selection, But this is a good (free) start!
You will need to register with CodeProject in order to download the code, but it is also free - and worth it because there is so much good code on this site!
UPDATE: By the way, I just looked at the blog that Joachim Kerschbaumer mentions in another answer to your question. Definitely follow this project! It looks like a very reliable solution. If he can read these skewed barcodes from these downloaded images, then he can do anything!
Doug L.
source share