How to extract only CR No only from image

Viewed 18

Sample image

I need to extract CR No.from the sample image given above. Using Easyocr, I got the output in complex nested list form. How to update the code to filter out all the detected text/numbers and get only CR No. I am running out of ideas, and help will be appreciated. What I have tried so far-

#Import libraries

import os
import easyocr
import cv2
from matplotlib import pyplot as plt
import numpy as np


IMAGE_PATH = 'H://CDAC//Spyder_projects//CR_No//input_image//input7.jpg'
reader = easyocr.Reader(['en'])
result3 = reader.readtext(IMAGE_PATH)
result3


my_list2 = []

length = len(result3)

for i in range(length):
    if (result3[i][1]) == 'CR No':
        print(result3[i])
        print(result3[i+1])
        my_list2.append(result3[i+1]+result3[i])
        print(my_list2)


print('The CR No is:', my_list2[0][1])

The expected output should be- 211022203481161

0 Answers
Related