I need to recognize these two types of labels.
zBar does recognize some of the barcodes sometimes, but I'd need to catch the ones that it doesn't and detect the label, so I can try and straighten up the label, maybe enhance it with thresholding or other techniques, and more importantly, being able to cut the pieces of the label to send them to OCR so I have a fallback method for unreadable barcodes.
Any suggestions?

I'm using OpenCV 2 and Python 3.6

enter image description here

enter image description here

  • 1
    $\begingroup$ bar codes are optimized for recognizability and derotatability, and I'm pretty sure zbar does its best at finding potential candidates, whereas finding unevenly lit not-quite-rectangles in not strictly isometric images and correcting them is relatively hard. I think you make an easy problem hard! $\endgroup$ – Marcus Müller May 22 '18 at 6:56
  • 1
    $\begingroup$ (wouldn't the more logical step be improving the bar code reader itself?) $\endgroup$ – Marcus Müller May 22 '18 at 6:57
  • $\begingroup$ @MarcusMüller Sure, do you have any advice on how to improve the bar code reading? $\endgroup$ – Petruza May 22 '18 at 23:38
  • $\begingroup$ @MarcusMüller Also, if I put the first image through Tesseract, it returns rubbish. If instead I cut out the label and pass it again, it works flawlessly. Of course I need to do this automatically because there will be batches of thousands of photos. $\endgroup$ – Petruza May 23 '18 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.