title: Extract text from image using OCR in python
body: <p>I want to extract text from a specific area of the image like the name and ID number from identity card. The ID card from which I want to extract text is in the Chinese language(Chinese ID card).
  I have tried this code but it just extracts the address and date of birth which I don't need. I just need the <strong>name</strong> and <strong>ID number</strong>. </p>
  
  <pre><code>import cv2
  from PIL import Image
  import pytesseract
  import argparse
  import os
  
  image = cv2.imread("E:/face.jpg")
  gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  gray = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
  filename = "{}.png".format(os.getpid())
  cv2.imwrite(filename,gray)
  
  text = pytesseract.image_to_string(Image.open(filename), lang='chi_sim')
  print(text)
  os.remove(filename)
  </code></pre>
  
  <p>I have also attached the image from which I am trying to extract text. I have tried according to my knowledge but not succeeded.any help and guidance would be appreciated.<a href="https://i.stack.imgur.com/Lblqk.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Lblqk.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/dsmrD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dsmrD.png" alt="This is the binary image"></a></p>