tags:

views:

32

answers:

2

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

A: 

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.

Scharron
A: 

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
killer_PL