title: Not able to recognize word using pytesseract.image_to_string
body: <p>I am having an image with rotated text. I am getting the position for this text and cropping it and then I rotated this text. Till this I can see my text displayed perfectly. But now if I send this rotated text to 'pytesseract.image_to_string', it is not recognizing the text. Here is the code.</p>
  <pre><code>croped = orig[y:y+h, x:x+w].copy()
  cv2.imshow('cropped ',croped)
  text_img = cv2.cvtColor(croped, cv2.COLOR_BGR2GRAY)
  text_img_nt = cv2.bitwise_not(text_img)
  
  cv2.imshow('text img not ',text_img_nt)
  thresh = cv2.threshold(text_img_nt, 0, 255,cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
  coords = np.column_stack(np.where(thresh &gt; 0))
  angle = cv2.minAreaRect(coords)[-1]
  
  if angle &lt; -45:
       angle = -(90 + angle)
  else:
       angle = -angle
              
  (h, w) = text_img_nt.shape[:2]
  center = (w // 2, h // 2)
  M = cv2.getRotationMatrix2D(center, angle, 1.0)
  
  rotated = cv2.warpAffine(text_img_nt, M, (w, h),flags=cv2.INTER_CUBIC, borderMode=cv2.BORDER_REPLICATE)
  cv2.imshow('rotated',rotated)  
  cv2.waitKey(100000)
  config='-l eng --oem 1 --psm 3'
  textRecognized = pytesseract.image_to_string(rotated, config = config, lang ='eng')
  print(textRecognized)
  </code></pre>
  <p><a href="https://i.stack.imgur.com/HjzUi.png" rel="nofollow noreferrer">Cropped Image</a>
  <a href="https://i.stack.imgur.com/cDIEa.png" rel="nofollow noreferrer">Rotated Image</a></p>
  <p>text recognized : &quot;Ol Ey&quot;</p>
  <p>Is there any issue in my code? Any help will be much appreciated.</p>