【问题标题】:What methods should i use to recognize distorted and kinked captchas?我应该使用什么方法来识别扭曲和扭结的验证码?
【发布时间】: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 会更好吗?

【问题讨论】:

    标签: python ocr captcha


    【解决方案1】:

    花了很多时间后,我找到了答案。我希望如果有人对这个话题感兴趣,他们会发现我对他们模糊问题的回答是完整的:) 解决验证码的最快途径不在于分割(我还没有找到任何关于如何精确摆脱验证码中所有复杂连字的答案)。因此,只有一种方法可以生成验证码训练集并创建 CNN 模型。 如果您不了解 php,则生成数据集并不容易,因为大多数验证码脚本都是用 PHP 编写的。对我来说,我发现了非常有用的生成脚本“kcaptcha”(它有扭曲和奇怪的字体)。 CNN 模型的制作并不简单,因为在模型的最后,我们希望它有 N 个输出折叠成一个(其中 N 个字母)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-13
      • 1970-01-01
      • 2016-09-19
      • 1970-01-01
      • 2011-06-22
      • 1970-01-01
      • 2017-07-14
      • 1970-01-01
      相关资源
      最近更新 更多