decode a barcode from image

Jun 12, 2004 5 Replies

Hai, I gotta decode a barcode from an image ( ppm, bmp, or jpg). I realize the first milestone would be to recognize a barcode with in the image:



I took a small window (say 80X80 pixels) and if a barcode is present in this window all pixels horizontally would have the same values. Well as you can see this is not perfect. I'm right now working with PPM image.



and then to decode the barcode itself (which i've no clue how to do).



I've searched the for a long time but could not find any help regarding barcode decoding. I would appritiate if any of you can provide me any help at all.



Thanks in advance.



Krishna


Hi Krishna,

"Krishna Sagiraju" schrieb in news: snipped-for-privacy@news.teranews.com:

The first step should be to find the orientation. Are the lines paralell to the border? If not, you should first rotate the picture or find the orientation.

What kind of bar code? EAN, UPC, Code39............ There are so many coding schemes for bar codes.

Regards, Kurt

PiN - Präsenz im Netz GITmbH Kurt Harders http://www.pin-gmbh.com

Please allow me to explain the senario, I use a ccd camera to capture the image, then i need to check the image for a barcode, which still remains my primary objective, and let's assume the barcode is parallel to height and that i;m working with code 128 currently. If i sucessfully implement the decoder i would consider other encodings. Oh! i forgot to mention i'm using Linux.

Not necessarily. I've decoded UPCish and Postnet barcodes in images without bothering to locate the barcode first.

Yup, I was only able to find commercial solutions and (scanning) hardware information.

I'm planning on working on decoding of UPC-like barcodes again soon for a newly-started project.

--kyler

You can find lots of barcode information at links at

formatting link

Check this article out:

formatting link

Adapt the ideas on it to image instead of hardware.

Tomi Engdahl (http://www.iki.fi/then/) Take a look at my electronics web links and documents at http://www.epanorama.net/

Here is a technical reference,

The Bar Code Book: Reading, Printing, and Specification of Bar Code Symbols by Roger C. Palmer

"

formatting link
""
formatting link
"

Depending on your application, you can limit the symbologies. The type of bar code you use depends a great deal on the application. For instance, 2D bar codes pack so much info they can be used without access to a DB. Code3of9 have a richer information set (similar to track 1/3 of a magnetic card) allowing numbers and alpha characters. These are typically used on skids of merchandise and hence are common in warehouse application. UPC is the de-facto for consumer/retail uses. These only include product numbers that are managed like a MAC addresses. One portion represents a manufacture another is the specific product.

You really need better requirements. Either from your boss or if you are doing this on your own, try to figure out exactly what you are doing. If you limit to a few symbologies, pre-processing to find the "barcode" is unnecessary (as another poster noted). However, if you do

*all known* symbologies, you will pick up barcodes in noise. Some seldom used barcodes have no redundancy and you can _erroneously_ read "blue jeans" or anything with striped patterns on it.

fwiw, Bill Pringlemeir.

I can remember when the air was clean and sex was dirty. - George Burns

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required