0

I have the following images:

https://i.stack.imgur.com/sdEJQ.jpg - Die showing 1

https://i.stack.imgur.com/I4FTB.jpg - Die showing 2

https://i.stack.imgur.com/vmys7.jpg - Die showing 3

https://i.stack.imgur.com/UhZXp.jpg - Die showing 4

https://i.stack.imgur.com/KyDz5.jpg - Die showing 5

https://i.stack.imgur.com/O9y1p.jpg - Die showing 6

That I want to perform OCR on using Tesseract. However, the problem is the Tesseract OCR does not work well on rotated images so I want to rotate the image into an upright orientation. I am not sure how to do this as I am a beginner with OpenCV. Can someone guide me on how to rotate these images ? Thank you

  • 1
    Threshold. Then get contour of square white background of face of cube. Then get contour and its rotated rectangle. Then get angle of rotation. – fmw42 Apr 05 '22 at 18:47
  • @fmw42 by threshold, you mean binary threshold right? Then get the contours using that? I am not sure to do the steps after that, could you please write out a code example if you have time. I have tried the code here to rotate before making this post : https://stackoverflow.com/questions/57713358/how-to-rotate-skewed-fingerprint-image-to-vertical-upright-position but it did not work for me. The angle printed was always -0.0 for some reason – diceReaderGuy Apr 05 '22 at 19:16
  • Yes, binary threshold. See example at https://stackoverflow.com/questions/59450102/calculating-the-orientation-of-a-figure-to-straighten-it-out-in-python/59462989#59462989. – fmw42 Apr 05 '22 at 20:40

0 Answers0