pythonopencvimage-processingimage-enhancement

How to identify numbers in low quality image using OpenCV?


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


Solution

  • 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