Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] 一个识别图形验证码的方法 #45

Closed
AntonVanke opened this issue Jun 2, 2021 · 7 comments
Closed

[Feature request] 一个识别图形验证码的方法 #45

AntonVanke opened this issue Jun 2, 2021 · 7 comments

Comments

@AntonVanke
Copy link
Contributor

感觉可以通过Pillow来识别验证码


猜想的思路:

  1. 将需要找到的物体的图片裁剪成一个合适的大小,使其主要物体占据绝大部分
    2lpugs.png
  2. 降低上述图片颜色数量,提取某种像素点最多的颜色;例
    for x in range(len(np.array(img))):
        for y in range(len(np.array(img)[x])):
            np.array(img)[x][y] = [(np.array(img)[x][y][0] // 16) * 16, ……, (np.array(img)[x][y][2] // 16) * 16]
  3. 同样降低颜色数量处理目标图片,并将图片裁切成小块
  4. 将物体图片与目标图片小块比对,对比像素点最多的那一块就是验证码的答案
    2lpKvn.md.png

你怎么看

@yqchilde
Copy link
Owner

yqchilde commented Jun 2, 2021

唉,听起来不错,但是我不会实现(不会写🤣)

@AntonVanke
Copy link
Contributor Author

唉,听起来不错,但是我不会实现(不会写🤣)

我刚刚已经验证成功了😁,还可以,不过正确率有点低(75%)

@AntonVanke
Copy link
Contributor Author

刚才试了好长时间一直报错,最后突然发现验证码图片被拉伸了,原来是275*170拉伸了1.4倍

@yqchilde
Copy link
Owner

yqchilde commented Jun 3, 2021

可以可以,期待了,这样退会又省事许多

@yqchilde
Copy link
Owner

yqchilde commented Jun 3, 2021

👍 ,很棒啊,识别率还是可以的,感谢大佬PR

@AntonVanke
Copy link
Contributor Author

👍 ,很棒啊,识别率还是可以的,感谢大佬PR

😂

@lonercci
Copy link

大佬们牛批!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants