How to recognize these labels?

asked 2018-03-08 19:27:51 -0500

I need to detect these two kinds of labels, and tell them apart.
Could you give me some directions as to what functions and techniques to use?

I can rely on them being white rectangles with black text and barcodes in them, so that's a pattern I could use.
I'm already detecting most barcodes with zbar, so that works fine.
_For example, in the bottom label, the first 2 barcodes are detected by zbar, but not the last one_

But when zbar fails to read it, I need to resort to OCR, so I need some way to locate the strings of digits (alphanumeric not even needed) and then pass them to Tesseract or something.
Thanks!

image description

image description

edit retag flag offensive close merge delete

Comments

The first image is of a Code 39 barcode. This is a different symbology (character encoding to a bar-space pattern) than the second image, which contains three Code 128 barcodes. The barcodes in the second set, furthermore, have a particular encoded character pattern that indicate UCC field information.

The last barcode seems to have poor contrast and may be small enough relative to the pixel size, or poor enough contrast, that it may not reliably read from this image. There is an encoded check digit in Code 128 in order to validate that it was correctly read, and conforming Code 128 readers are not supposed to report a bar code which does not match its included check digit.

opalmirror gravatar imageopalmirror ( 2018-04-04 17:48:50 -0500 )edit