How to identify numbers in low quality image using OpenCV?

588 Views Asked by At

I need to convert the first image to the second image using python help with OpenCV. Please help me to do that!

Sample Input

Sample Input

Sample Output

Sample Output

1

There are 1 best solutions below

0
idevesh On BEST ANSWER

Use this code -

import cv2  
img  = cv2.imread(r'image.png',1)  
retval, threshold = cv2.threshold(img, 20, 255, cv2.THRESH_BINARY)  
cv2.imshow("Threshold",threshold)  
cv2.waitKey(0)  

OUTPUT -

enter image description here