【发布时间】:2019-04-04 15:18:27
【问题描述】:
我有一张验证码的图像,问题是我不知道如何处理视觉识别(CNN-wise(神经网络)或通过 OCR 库)
我尝试使用其他 stackoverflow 问题中的简单案例,但似乎它们很简单,因为在我的案例中它们重叠且严重扭曲。
示例 1:
示例 2:
for dilate in [1, 3, 4, 5]:
for erode in [1, 3, 4, 5]:
for thresh in [125, 150, 175, 200]:
img = cv.imread('cap.png', 0)
img = cv.resize(img, (300, 120))
ret, img = cv.threshold(img, thresh, 255, cv.THRESH_BINARY)
img = cv.dilate(img, np.ones((dilate,dilate), np.uint8))
img = cv.erode(img, np.ones((erode,erode), np.uint8))
text = pytesseract.image_to_string(img, lang='eng', config='--psm 7 -c tessedit_char_whitelist=0123456789abcdefghijklmnopqrstuvwxyz')
print(text)
我想了解我应该使用什么方法或从哪里开始。训练我自己的 CNN 会更好吗?
【问题讨论】: