محمدباقر
محمدباقر

Reputation: 285

OCR rotated image

I have a couple of images including labels that have angles between 0 and 180 degrees. Is there any way to detect them using existing OCR tools or any algorithm for that?

Upvotes: 3

Views: 2097

Answers (2)

Piotr Müller
Piotr Müller

Reputation: 5548

Some time ago i wrote such algorithm for this:

  • cut one letter
  • rotate it clockwise from -X degress to X degres from initial posiotion, stepping by 1-2 degrees
  • With each rotation catch it to a block, by checking most outside pixels in every side
  • With each rotation check/remember dimensions of a block
  • After all rotations find a block that have highest height/width ratio and rotate initial letter to that position
  • You have now properly rotated letter, but pay attension, that wide letters will lies on side (like W, will be rotated 90 degrees) so you have to create pattern for W for comparsion on its side, not normal

Upvotes: 1

Scharron
Scharron

Reputation: 17757

Tesseract, an open-source OCR now developped by Google will have an orientation detection feature in version 3.0. The code is included in the svn version, but I don't know if it works.

Upvotes: 0

Related Questions