I am using Gaussian kernel for image enhancements in OpenCV with 250% enlagrement:
import cv2
import numpy as np
image = cv2.imread("test.png")
small = cv2.resize(image, (0,0), fx=2.5, fy=2.5)
img = small
kernel_sharpen_3 = np.array([[-1,-1,-1,-1,-1],
[-1,2,2,2,-1],
[-1,2,8,2,-1],
[-1,2,2,2,-1],
[-1,-1,-1,-1,-1]]) / 8.0
output_3 = cv2.filter2D(img, -1, kernel_sharpen_3)
cv2.imwrite('enhancement.png', output_3)
cv2.waitKey(0)
cv2.destroyAllWindows()
But still doesn't give very good results. What other preprocessing should I do to improve the accuracy? I am using ocr.space as a tool.
Some examples:
- It incorrectly detected KIHC US as KI-IC US
- It incorrectly detected HRL US as HRI- US (second last row)
- It didn't detect BN FP
- It incorrectly detected HPQ US as I-IPQ US (But it has correctly detected H in HEN3 GR in the next row)
- It incorrectly detected LALAB MM as I-ALAB MM
- It didn't detect RB/ LN