title: How can I get text from this image with Tesseract?
body: <p>Currently I'm using the code below to get text from image and it works fine, but it doesn't work well with these two images, it seems like tesseract cannot scan these types of image. Please show me how to fix it</p>
  
  <p><a href="https://i.ibb.co/zNkbhKG/Untitled1.jpg" rel="nofollow noreferrer">https://i.ibb.co/zNkbhKG/Untitled1.jpg</a></p>
  
  <p><a href="https://i.ibb.co/XVbjc3s/Untitled3.jpg" rel="nofollow noreferrer">https://i.ibb.co/XVbjc3s/Untitled3.jpg</a></p>
  
  <pre><code>def read_screen():
          spinner = Halo(text='Reading screen', spinner='bouncingBar')
          spinner.start()
          screenshot_file="Screens/to_ocr.png"
          screen_grab(screenshot_file)
  
          #prepare argparse
          ap = argparse.ArgumentParser(description='HQ_Bot')
          ap.add_argument("-i", "--image", required=False,default=screenshot_file,help="path to input image to be OCR'd")
          ap.add_argument("-p", "--preprocess", type=str, default="thresh", help="type of preprocessing to be done")
          args = vars(ap.parse_args())
  
          # load the image 
          image = cv2.imread(args["image"])
          gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  
          if args["preprocess"] == "thresh":
                  gray = cv2.threshold(gray, 177, 177,
                          cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
          elif args["preprocess"] == "blur":
                  gray = cv2.medianBlur(gray, 3)
  
          # store grayscale image as a temp file to apply OCR
          filename = "Screens/{}.png".format(os.getpid())
          cv2.imwrite(filename, gray)
  
          # load the image as a PIL/Pillow image, apply OCR, and then delete the temporary file
          pytesseract.pytesseract.tesseract_cmd = 'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'
          #ENG
          #text = pytesseract.image_to_string(Image.open(filename))
  
          #VIET
          text = pytesseract.image_to_string(Image.open(filename), lang='vie')
  
          os.remove(filename)
          os.remove(screenshot_file)
  
          # show the output images
  
          '''cv2.imshow("Image", image)
          cv2.imshow("Output", gray)
          os.remove(screenshot_file)
          if cv2.waitKey(0):
                  cv2.destroyAllWindows()
          print(text)
          '''
          spinner.succeed()
          spinner.stop()
          return text
  </code></pre>