我正试图清除验证码并去掉线路
原始图像:
这就是我目前的情况:
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)
试图找出如何改善结果,如果有任何提示,我们将不胜感激
您可以尝试应用中给出的预处理步骤-
https://tesseract-ocr.github.io/tessdoc/ImproveQuality
然后将预处理后的图像交给Google Tesseract OCR
我确信它会识别验证码
相关问题 更多 >
编程相关推荐