如何识别一张图片上的数字?
如何识别一张图片上的数字?那位高手有算法,分享一下! 曾经设计过这样的一个算法。另外,如果你贴上图片的话可能问题会比较容易解决 本帖最后由 tryhi 于 2011-6-30 16:00 编辑
这一个5*8的像素组成的数字根据其中七点(不知道能不能用6点,反正我最少想出七点)判断出数字。
If $numx1 = 1 And $numx2 = 0 And $numx3 = 0 And $numx4 = 0 And $numx5 = 0 And $numx6 = 0 And $numx7 = 0 Then Return 0
If $numx1 = 0 And $numx2 = 0 And $numx3 = 0 And $numx4 = 1 And $numx5 = 0 And $numx6 = 1 And $numx7 = 0 Then Return 1
If $numx1 = 0 And $numx2 = 0 And $numx3 = 0 And $numx4 = 1 And $numx5 = 0 And $numx6 = 0 And $numx7 = 1 Then Return 2
If $numx1 = 0 And $numx2 = 0 And $numx3 = 0 And $numx4 = 0 And $numx5 = 0 And $numx6 = 1 And $numx7 = 0 Then Return 3
If $numx1 = 0 And $numx2 = 1 And $numx3 = 0 And $numx4 = 0 And $numx5 = 0 And $numx6 = 0 And $numx7 = 1 Then Return 4
If $numx1 = 1 And $numx2 = 1 And $numx3 = 1 And $numx4 = 0 And $numx5 = 0 And $numx6 = 1 And $numx7 = 0 Then Return 5
If $numx1 = 1 And $numx2 = 1 And $numx3 = 0 And $numx4 = 0 And $numx5 = 0 And $numx6 = 1 And $numx7 = 0 Then Return 6
If $numx1 = 0 And $numx2 = 0 And $numx3 = 1 And $numx4 = 1 And $numx5 = 0 And $numx6 = 1 And $numx7 = 0 Then Return 7
If $numx1 = 0 And $numx2 = 1 And $numx3 = 0 And $numx4 = 0 And $numx5 = 0 And $numx6 = 1 And $numx7 = 0 Then Return 8
If $numx1 = 1 And $numx2 = 0 And $numx3 = 0 And $numx4 = 1 And $numx5 = 1 And $numx6 = 0 And $numx7 = 0 Then Return 9 验证码??? 不是,看来这个问题比较复杂,打算换一种思路来解顽皮遇到的问题了 这一个5*8的像素组成的数字根据其中七点(不知道能不能用6点,反正我最少想出七点)判断出数字。
tryhi 发表于 2011-6-30 12:39 http://www.autoitx.com/images/common/back.gif
请问,你这算法是基于哪种字体的?能有通用的算法吗? 楼主想做验证码么??? 请问,你这算法是基于哪种字体的?能有通用的算法吗?
easefull 发表于 2011-7-6 01:59 http://www.autoitx.com/images/common/back.gif
字体我忘了,好像跟右下角的时间同种字体,没有通用性,必须5x8,而且是确定字体,可惜我确定点的分析过程被我删了,不然对你应该有用。我这个月不用电脑,所以没办法详细说了
页:
[1]