"Krishna Sagiraju" <sa******@gmail.com> wrote in message
news:d3******************************@news.teranew s.com...
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
I wrote some type 128 barcode reading software not too long ago using
information from this site:
http://www.adams1.com/pub/russadam/128code.html
My employer might not like me sharing the software with you but I can give
you the outline of the algorithm:
1) average down to 1D
2) determine the location of all edges using gray interpolation
3) subtract to get the width of each bar and space
4) estimate the scaling factor which makes each bar and space approximately
1, 2, 3, or 4 times the smallest one
5) decode as shown on the website
Of course this assumes you are reading type 128 barcodes. Other types work
about the same except for the encoding.
--
Cy
http://home.rochester.rr.com/cyhome/