我在试着清理验证码去掉line,
原图:

这是我目前所拥有的:

img_raw = cv2.imread("captcha.png", cv2.IMREAD_GRAYSCALE)
img_raw = cv2.bitwise_not(img_raw)
kernel = np.ones((0, 0), np.uint8)
img_m = cv2.morphologyEx(img_raw, cv2.MORPH_OPEN, kernel)
newkernel = np.ones((0, 0), np.uint8)
img_e = cv2.erode(img_m, newkernel, iterations=1)
img_e = cv2.bitwise_not(img_e)
ret,img_final = cv2.threshold(img_e,100,255,cv2.THRESH_BINARY)尝试找出如何改善结果,如果有任何建议,将非常感谢
发布于 2021-02-11 20:32:13
您可以尝试应用中给出的预处理步骤-
https://tesseract-ocr.github.io/tessdoc/ImproveQuality
然后将预处理后的图像提供给Google Tesseract OCR。
我确信它会识别验证码。
https://stackoverflow.com/questions/66096469
复制相似问题