At present, the verification codes of many systems are becoming more and more complex and difficult to recognize by human eyes, especially for verification codes such as QQ. It is too difficult to identify them.
There is a verification code:
Generally, the verification codes are pre-processed, split, and identified. This verification code has no other noise, but there is a cross curve interference, and the font in the verification code is stuck together.
If the interference curve is not removed, the whole recognition will be affected. To solve this problem, first remove this curve. The first method is to obtain the first position of the curve (X, y), this part is very simple,CodeAs follows:
1 Def Get_left_start_point (IM ):
2 Start_point = (0, 0)
3 Found = False
4 W, h = Im. Size
5 Data = List (IM. getdata ())
6 For X In Xrange (W ):
7 For Y In Xrange (h ):
8 If Data [y * W + X] ! = White :
9 Found = True
10 Start_point = (X, y)
11 Break
12
13 If Found:
14 Break
15 Return Start_point
After obtaining the header node, traverse it from left to right in sequence to determine whether it is a black spot, save the Coordinate Position of the line, and then remove the line position (thanks to Sun zhihai's friend) (CODE)
So we can get the image after removing the black line:
Except for several isolated points, the black lines in the image are basically removed. Below are some of the items that are better processed:
The following process is poor:
In view of the fact that the previous Blog content has been reposted on the Internet and does not indicate the source, add the following content:
Author: External oon
Homepage: http://qtrstudio.com
Blog: http://www.cnblogs.com/ubunoon; http://qtrstudio.com/blog
Email: netubu # gmail.com
Copyright: Copyright 2011. All rights reserved.