Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am new to tensorflow, so i am little bit confuse in tensorflow there are multiple model to perform OCR like

  1. attention_ocr
  2. street

I have below document which i have to perform OCR. I tried to use pytesseract to read image but not giving proper result. enter image description here

I need below result from above image

  • D MANIKANDAN

  • DURAISAMY

  • 16/07/1986

  • BNZPM2501F

Please suggest me please tensorflow modal is useful to perform above OCR. I am using below code to get data from pytesseract

def getData(coordinate, image):
    (y1, y2, x1, x2, classification) = coordinate
    ts = int(time.time())
    height = y2-y1
    width = x2-x1
    crop = image[y1:y1+height, x1:x1+width]
    CROP_IMAGE_URL = EXPORT_PATH +"data.jpg"
    cv2.imwrite(CROP_IMAGE_URL, crop)
    img = cv2.imread(CROP_IMAGE_URL)
    text = pytesseract.image_to_string(img)
    os.remove(CROP_IMAGE_URL)
    return text
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
302 views
Welcome To Ask or Share your Answers For Others

1 Answer

First you must create an object detection model to find the region of intrests as shown in the picture. Then you can pass the ROI image into the OCR model or PyTesseract.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...