0

Picture a piece of metal bar, 20mm long, about 30mm round. On the bar, there is numbers stamped. 10 characters, 4.5mm high, spread around approximately 120° of the circumference.

I need to perform OCR on the characters BUT the text characters are not all visible in one image. Three images spaced at around 30° seems to look ok.

Next issue is the metal is freshly machined and the text characters do not seem to OCR well; I think due to the lack of real contrast. ie black/white difference.

Does anyone have any ideas on how these characters could be OCR'd??

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345

1 Answers1

0

You could try this ImageMagick command to increase 'contrast'. It basically leaves over only 2 values (zero or maximum) for each color. Every value below the threshold gets set to 0, values above the threshold get set to 255 (or 65535 if working at 16-bit depth):

 convert  original.jpg  -threshold 50%  modified.jpg

Play with the value of 50% to get best results -- set it higher or lower... Depending on your input image, this could already be enough to get images that are OK for OCR-ing.

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345