类似于Python验证码的图像失真 [英] Python CAPTCHA-like image disortion

查看:96
本文介绍了类似于Python验证码的图像失真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想按照标准CAPTCHA对字体进行分类的方式对某些图像进行分类。我将如何在python中实现它?我应该使用哪些库/算法?有任何概念证明吗?

I would like to disort some images the same way standard CAPTCHA disorts fonts. How would I achieve it in python? What libraries/algorithms I should use? Any proof-of-concept?

免责声明:在询问这个问题之前,我已经搜索了一段时间,但找不到满意的答案。我是该领域的新手,所以我无法提供任何证明我的研究努力的代码...

DISCLAIMER: I was googling for some time before I asked this question but I couldn't find any satisfying answer. I'm new to the field so I can't provide any code proving my 'research effort'...

推荐答案

I认为您正在寻找PyCaptcha http://svn.navi.cx/misc/trunk/pycaptcha/

I think you are looking for PyCaptcha http://svn.navi.cx/misc/trunk/pycaptcha/

要扭曲的实际代码在这里: http://svn.navi.cx/misc/trunk/pycaptcha/Captcha/Visual/Distortions.py

The actual code to distort is here: http://svn.navi.cx/misc/trunk/pycaptcha/Captcha/Visual/Distortions.py

该工作是由PIL的转换函数,例如:

The work is done by PIL's transform function, like this:

image.transform(image.size, Image.MESH, mesh, self.filtering)

其余的代码本质上是用来生成所使用的网格的。

The rest of the code is there essentially to generate the mesh that is used.

这篇关于类似于Python验证码的图像失真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆