Wednesday, 30 November 2022

Improving small images for data extraction

In Open CV or with Pillow library how can we improve below images for tesseract.

Images

Images

Images

I tried below code with multiple options like thresholding, blur, enchance, however not able to improve.

img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
print(pytesseract.image_to_string(img))

img_medianBlur = cv2.blur(img, (3 , 3))

print(pytesseract.image_to_string(img_medianBlur))

blur = cv2.GaussianBlur(img,(5,5),0)

ret3,th3 = cv2.threshold(img,150,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)

print(pytesseract.image_to_string(th3))


from Improving small images for data extraction

No comments:

Post a Comment