[英]How to clean up captcha image?
我正在嘗試清理驗證碼並擺脫線路,
原圖:
這就是我目前所擁有的:
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。
我確信它會識別驗證碼。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.