Skip to main content
GameDev.net gamedev.net
🔒 Locked

OCR/Barcode Recognition

Started by Eight Dec 10, 2002 at 10:02 AM 2 replies 1.1k views
Original Post
Eight
Eight
Hi there, I don''t suppose anyone knows of any links/docs which cover the basic algorithms etc. of OCR or preferably, barcode (from a bitmap image) recognition? Can''t be that hard surely. E
S1CA
S1CA

How hard it is depends on the constraints.

Is the barcode aligned correctly on whatever you''re using to do the scanning or will your code have to work out realignment?

Is the barcode on a nice flat plane or is it wrapped around something like a cylinder (implying unwrapping to a plane before trying to decode) ?

Is the barcode clean and undamaged, or could it have an oily fingerprint in the middle or a tear down part of it.

Is the barcode coloured?

Really all you need to work out is the size of the code, then the ratio of dark to light between lines in that space.

A good place to start IMO would be actually going backwards - write a barcode printing program - you''ll find many more resources on the web for that than you will for scanning which is done by specialist hardware in 99% of cases.

Search Google for something like CODE39+UPC+Printing+algorithm

Once you know the individual ratios depending on the type of code you''re trying to scan, then all that''s left is the scanning/detection/OCR stuff - the checksums can be of use.

If it''s shop purchased products you want to scan, then UPC is the type you''ll be detecting. For most specialist (and small volume) uses CODE39 is more common.


Also what you intend in doing with the code your software has read is probably going to take the longer time, e.g. a Universal Product Code on a shop bought item is just that, a code - doesn''t hold any more information unless you have a UPC database to check it against.


BTW: RS232 barcode readers are dirt cheap which would save a lot of time...



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
Eight
Eight
Thanks for your advice Simon.

You''re absolutely right, I really should start with writing a barcode painting algorithm and work from there.

Cheers.

E
daerid
daerid
Wow... I was just asked to look into this yesterday.

Thanks a lot for the tips!
daerid@gmail.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.