I am trying to process the captcha image.I want to process different type of captcha image to extract actual text.I am using open cv to do this job it is working fine but the problem is I need to set different lower threshold to convert greyscale to binary image.
Main goal : I am trying to remove that horizontal line and make the character clear to read
Code used:
import cv2
# Load an color image in grayscale
img = cv2.imread('it_captcha3.jpg',0)
ret, thresh_img = cv2.threshold(img, 180, 255, cv2.THRESH_BINARY_INV)
cv2.imshow('grey image',thresh_img)
cv2.imwrite("result11.jpg", thresh_img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Captcha1 :
Processed image : threshold used -> low: 180 high ->255,
CAPTCHA : 2
PROCESSED IMAGE: threshold used -> low: 200 high ->255
captcha : 3
processed : low -> 165 high : 255