Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Barcode Recognition

by themage (Friar)
on Aug 26, 2008 at 15:07 UTC ( #706917=note: print w/ replies, xml ) Need Help??


in reply to Barcode Recognition

Se simpler way to go, probably, was to print the images you have and use a keyboard connectable scanner to parse the barcodes you have.

But if you want an alternative to that, you will need to:

  1. Parse the Image and transform it in a representation you can easly parse, for example, 0 for a white bar, 1 for a black bar and L for a long bar.
  2. For most bar encodings (and specificly for EAN13) you can remove the initial and final "L0L" and the middle "0L0L0".
  3. Now you need to convert each group of 7 "0" and "1" to a number.
  4. You will need to guess which is the first digit, as it is not encoded in the barcode, but you can find out which it is by comparing the sequence of encondings used in the bar code.

Note: You need to use the width of the long bar (not it's height) to know if a bar is a single binary digit or more than one. A slim bar is a digit, a large on is two, or even three or four digits. For example, 6 using L-Code have 4 consecutive "1" digits (black bars) and using G or R-Code have the same 4 but "0" digits (white bars).

More info at wikipedia.


Comment on Re: Barcode Recognition

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://706917]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2014-08-27 11:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (237 votes), past polls