Home > Backend Development > PHP Tutorial > PHP verification code recognition, php verification code_PHP tutorial

PHP verification code recognition, php verification code_PHP tutorial

WBOY
Release: 2016-07-13 10:21:27
Original
1840 people have browsed it

PHP verification code recognition, php verification code

First of all, I recommend a few articles about verification code recognition, which I think are good

PHP implements verification code recognition (primary)

About bp Neural Grid Recognition Verification Code

1. Ideas

When we encounter a verification code, if we want to recognize it, what do we need to do?
Let’s observe a few verification codes first......


When we observe it with the human eye, we will clearly recognize the characters contained in the verification code. So what is the "recognition mechanism" of the human eye?
It is probably the color difference between the background of the characters in the verification code image. Just imagine, if there is no color difference between the characters and the background, can we judge the verification code? Obviously not.

So, we can start from people.

Start with the color of the image, that is, the RGB information of the image.

RGB色彩模式是工业界的一种颜色标准,是通过对红(R)、绿(G)、蓝(B)三个颜色通道的变化以及它们相互之间的叠加来得到各式各样的颜色的,RGB即是代表红、绿、蓝三个通道的颜色,这个标准几乎包括了人类视力所能感知的所有颜色,是目前运用最广的颜色系统之一。
Copy after login

Define a function to obtain RGB information

<span> 1</span> <span>//</span><span>代码本来是一个类,现在拆开来写的,有可能有不严谨的地方,大家可以看得懂就好了</span>
<span> 2</span> 
<span> 3</span> <span>/*</span>
<span> 4</span> <span> *取得图片路径和图片尺寸
</span><span> 5</span>  <span>*/</span>
<span> 6</span> <span>$this</span>->ImagePath = <span>$Image</span><span>;
</span><span> 7</span> <span>$this</span>->ImageSize = <span>getimagesize</span>(<span>$Image</span><span>);
</span><span> 8</span> 
<span> 9</span> <span>/*</span>
<span>10</span> <span> *获取图像标识符,保存到ImageInfo,只能处理bmp,png,jpg图片
</span><span>11</span> <span> *ImageCreateFromBmp是我自己定义的函数,最后会给出
</span><span>12</span>  <span>*/</span>
<span>13</span> <span>function</span><span> getInfo(){
</span><span>14</span>     <span>$filetype</span> = <span>substr</span>(<span>$this</span>->ImagePath,-3<span>);
</span><span>15</span>     <span>if</span>(<span>$filetype</span> == 'bmp'<span>){
</span><span>16</span>         <span>$this</span>->ImageInfo = <span>$this</span>->ImageCreateFromBmp(<span>$this</span>-><span>ImagePath);
</span><span>17</span>     }<span>elseif</span>(<span>$filetype</span> == 'jpg'<span>){
</span><span>18</span>         <span>$this</span>->ImageInfo = imagecreatefromjpeg(<span>$this</span>-><span>ImagePath);    
</span><span>19</span>     }<span>elseif</span>(<span>$filetype</span> == 'png'<span>){
</span><span>20</span>         <span>$this</span>->ImageInfo = imagecreatefrompng(<span>$this</span>-><span>ImagePath);    
</span><span>21</span> <span>    }
</span><span>22</span> <span>}
</span><span>23</span> 
<span>24</span> <span>/*</span><span>获取图片RGB信息</span><span>*/</span>
<span>25</span> <span>function</span><span> getRgb(){
</span><span>26</span>     <span>$rgbArray</span> = <span>array</span><span>();
</span><span>27</span>     <span>$res</span> = <span>$this</span>-><span>ImageInfo;
</span><span>28</span>     <span>$size</span> = <span>$this</span>-><span>ImageSize;
</span><span>29</span>     <span>$wid</span> = <span>$size</span>['0'<span>];
</span><span>30</span>     <span>$hid</span> = <span>$size</span>['1'<span>];
</span><span>31</span>     <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$hid</span>; ++<span>$i</span><span>){
</span><span>32</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$wid</span>; ++<span>$j</span><span>){
</span><span>33</span>             <span>$rgb</span> = imagecolorat(<span>$res</span>,<span>$j</span>,<span>$i</span><span>);
</span><span>34</span>             <span>$rgbArray</span>[<span>$i</span>][<span>$j</span>] = imagecolorsforindex(<span>$res</span>, <span>$rgb</span><span>);
</span><span>35</span> <span>        }
</span><span>36</span> <span>    }
</span><span>37</span>     <span>return</span> <span>$rgbArray</span><span>;
</span><span>38</span> }
Copy after login

2. Binarization

Because the human eye can distinguish the verification code, the RGB information of the verification code will have certain characteristics. At this time, we need to observe it. It is difficult to observe directly printing the RGB array..., there are so many

In the recognition of verification code in PHP (primary article), the author’s judgment is based on

无论验证数字颜色如何变化,该数字的 RGB 值总有一个值小于 125
Copy after login

We first obtain his grayscale and then judge

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *获取灰度信息
</span><span> 3</span>  <span>*/</span>
<span> 4</span> <span>function</span><span> getGray(){
</span><span> 5</span>     <span>$grayArray</span> = <span>array</span><span>();
</span><span> 6</span>     <span>$size</span> = <span>$this</span>-><span>ImageSize;
</span><span> 7</span>     <span>$rgbarray</span> = <span>$this</span>-><span>getRgb();
</span><span> 8</span>     <span>$wid</span> = <span>$size</span>['0'<span>];
</span><span> 9</span>     <span>$hid</span> = <span>$size</span>['1'<span>];
</span><span>10</span>     <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$hid</span>; ++<span>$i</span><span>){
</span><span>11</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$wid</span>; ++<span>$j</span><span>){
</span><span>12</span>             <span>$grayArray</span>[<span>$i</span>][<span>$j</span>] = (299*<span>$rgbarray</span>[<span>$i</span>][<span>$j</span>]['red']+587*<span>$rgbarray</span>[<span>$i</span>][<span>$j</span>]['green']+144*<span>$rgbarray</span>[<span>$i</span>][<span>$j</span>]['blue'])/1000<span>;
</span><span>13</span> <span>        }
</span><span>14</span> <span>    }
</span><span>15</span>     <span>return</span> <span>$grayArray</span><span>;
</span><span>16</span> }
Copy after login

Then we print the picture based on the grayscale information. Note that we do not print the grayscale information

<span> 1</span> <span>/*</span><span>根据灰度信息打印图片</span><span>*/</span>
<span> 2</span> <span>function</span><span> printByGray(){
</span><span> 3</span>     <span>$size</span> = <span>$this</span>-><span>ImageSize;    
</span><span> 4</span>     <span>$grayArray</span> = <span>$this</span>-><span>getGray();
</span><span> 5</span>     <span>$wid</span> = <span>$size</span>['0'<span>];
</span><span> 6</span>     <span>$hid</span> = <span>$size</span>['1'<span>];
</span><span> 7</span>     <span>for</span>(<span>$k</span>=0;<span>$k</span><25;<span>$k</span>++<span>){
</span><span> 8</span>         <span>echo</span> <span>$k</span>."\n"<span>;
</span><span> 9</span>         <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$hid</span>; ++<span>$i</span><span>){
</span><span>10</span>             <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$wid</span>; ++<span>$j</span><span>){
</span><span>11</span>                 <span>if</span>(<span>$grayArray</span>[<span>$i</span>][<span>$j</span>] < <span>$k</span>*10<span>){
</span><span>12</span>                     <span>echo</span> '■'<span>;
</span><span>13</span>                 }<span>else</span><span>{
</span><span>14</span>                     <span>echo</span> '□'<span>;
</span><span>15</span> <span>                }
</span><span>16</span> <span>            }
</span><span>17</span>             <span>echo</span> "|\n"<span>;
</span><span>18</span> <span>        }
</span><span>19</span>         <span>echo</span> "---------------------------------------------------------------------------------------------------------------\n"<span>;
</span><span>20</span> <span>    }
</span><span>21</span>     
<span>22</span> }
Copy after login

Notice that there will be obvious output from $grayArray[$i][$j] < 80. We observed and selected an appropriate threshold and obtained an array of 0101. We have converted our image into Character (1) and background (0), that is, binarization.

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *根据自定义的规则,获取二值化二维数组
</span><span> 3</span> <span> *@return  图片高*宽的二值数组(0,1)
</span><span> 4</span>  <span>*/</span>
<span> 5</span> <span>function</span><span> getErzhi(){
</span><span> 6</span>     <span>$erzhiArray</span> = <span>array</span><span>();
</span><span> 7</span>     <span>$size</span> = <span>$this</span>-><span>ImageSize;
</span><span> 8</span>     <span>$grayArray</span> = <span>$this</span>-><span>getGray();
</span><span> 9</span>     <span>$wid</span> = <span>$size</span>['0'<span>];
</span><span>10</span>     <span>$hid</span> = <span>$size</span>['1'<span>];
</span><span>11</span>     <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$hid</span>; ++<span>$i</span><span>){
</span><span>12</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> <<span>$wid</span>; ++<span>$j</span><span>){
</span><span>13</span>             <span>if</span>( <span>$grayArray</span>[<span>$i</span>][<span>$j</span>]    < 90<span> ){
</span><span>14</span>                 <span>$erzhiArray</span>[<span>$i</span>][<span>$j</span>]=1<span>;
</span><span>15</span>             }<span>else</span><span>{
</span><span>16</span>                 <span>$erzhiArray</span>[<span>$i</span>][<span>$j</span>]=0<span>;
</span><span>17</span> <span>            }
</span><span>18</span> <span>        }
</span><span>19</span> <span>    }
</span><span>20</span>     <span>return</span> <span>$erzhiArray</span><span>;
</span><span>21</span> }
Copy after login

3. Noise removal

But we found some small points that affected our judgment

We can notice these interference noise points, but if we are machines, how do we judge whether these points are characters?

So next, we need to remove these characters.

We judge that if the eight points above, below, left, and right of a black point are all white, we will think it is a noise point, remove it, and assign it as white

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *二值化图片降噪
</span><span> 3</span> <span> *@param $erzhiArray二值化数组
</span><span> 4</span>  <span>*/</span>
<span> 5</span> <span>function</span> reduceZao(<span>$erzhiArray</span><span>){
</span><span> 6</span>     <span>$data</span> = <span>$erzhiArray</span><span>;
</span><span> 7</span>     <span>$gao</span> = <span>count</span>(<span>$erzhiArray</span><span>);
</span><span> 8</span>     <span>$chang</span> = <span>count</span>(<span>$erzhiArray</span>['0'<span>]);
</span><span> 9</span> 
<span>10</span>     <span>$jiangzaoErzhiArray</span> = <span>array</span><span>();
</span><span>11</span> 
<span>12</span>     <span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$gao</span>;<span>$i</span>++<span>){
</span><span>13</span>         <span>for</span>(<span>$j</span>=0;<span>$j</span><<span>$chang</span>;<span>$j</span>++<span>){
</span><span>14</span>             <span>$num</span> = 0<span>;  
</span><span>15</span>             <span>if</span>(<span>$data</span>[<span>$i</span>][<span>$j</span>] == 1<span>)  
</span><span>16</span> <span>            {
</span><span>17</span>                 <span>//</span><span> 上  </span>
<span>18</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>-1][<span>$j</span><span>])){  
</span><span>19</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>-1][<span>$j</span><span>];  
</span><span>20</span> <span>                }  
</span><span>21</span>                 <span>//</span><span> 下  </span>
<span>22</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>+1][<span>$j</span><span>])){  
</span><span>23</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>+1][<span>$j</span><span>];  
</span><span>24</span> <span>                }  
</span><span>25</span>                 <span>//</span><span> 左  </span>
<span>26</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>][<span>$j</span>-1<span>])){  
</span><span>27</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>][<span>$j</span>-1<span>];  
</span><span>28</span> <span>                }  
</span><span>29</span>                 <span>//</span><span> 右  </span>
<span>30</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>][<span>$j</span>+1<span>])){  
</span><span>31</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>][<span>$j</span>+1<span>];  
</span><span>32</span> <span>                }  
</span><span>33</span>                 <span>//</span><span> 上左  </span>
<span>34</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>-1][<span>$j</span>-1<span>])){  
</span><span>35</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>-1][<span>$j</span>-1<span>];  
</span><span>36</span> <span>                }  
</span><span>37</span>                 <span>//</span><span> 上右  </span>
<span>38</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>-1][<span>$j</span>+1<span>])){  
</span><span>39</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>-1][<span>$j</span>+1<span>];  
</span><span>40</span> <span>                }  
</span><span>41</span>                 <span>//</span><span> 下左  </span>
<span>42</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>+1][<span>$j</span>-1<span>])){  
</span><span>43</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>+1][<span>$j</span>-1<span>];  
</span><span>44</span> <span>                }  
</span><span>45</span>                 <span>//</span><span> 下右  </span>
<span>46</span>                 <span>if</span>(<span>isset</span>(<span>$data</span>[<span>$i</span>+1][<span>$j</span>+1<span>])){  
</span><span>47</span>                     <span>$num</span> = <span>$num</span> + <span>$data</span>[<span>$i</span>+1][<span>$j</span>+1<span>];  
</span><span>48</span> <span>                }  
</span><span>49</span> <span>            }
</span><span>50</span> 
<span>51</span>                 <span>if</span>(<span>$num</span> < 1<span>){  
</span><span>52</span>                     <span>$jiangzaoErzhiArray</span>[<span>$i</span>][<span>$j</span>] = 0<span>;  
</span><span>53</span>                 }<span>else</span><span>{
</span><span>54</span>                     <span>$jiangzaoErzhiArray</span>[<span>$i</span>][<span>$j</span>] = 1<span>;  
</span><span>55</span> <span>                }
</span><span>56</span> <span>        }
</span><span>57</span> <span>    }
</span><span>58</span>     <span>return</span> <span>$jiangzaoErzhiArray</span><span>;    
</span><span>59</span> 
<span>60</span> }
Copy after login

We found that the noise disappeared.

4. Division

At this time, we need to operate on single numbers and letters. We first extract the numbers.

Some of the verification code characters are connected, which is particularly difficult!!!

We scan from left to right, from right to left, from top to bottom, and from bottom to top, remove white spots, and find the border.

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *归一化处理,针对一个个的数字,即去除字符周围的白点
</span><span> 3</span> <span> *@param $singleArray 二值化数组
</span><span> 4</span>  <span>*/</span>
<span> 5</span> <span>function</span> getJinsuo(<span>$singleArray</span><span>){
</span><span> 6</span>     <span>$dianCount</span> = 0<span>;
</span><span> 7</span>     <span>$rearr</span> = <span>array</span><span>();
</span><span> 8</span>     
<span> 9</span>     <span>$gao</span> = <span>count</span>(<span>$singleArray</span><span>);
</span><span>10</span>     <span>$kuan</span> = <span>count</span>(<span>$singleArray</span>['0'<span>]);
</span><span>11</span>     
<span>12</span>     <span>$dianCount</span> = 0<span>;
</span><span>13</span>     <span>$shangKuang</span> = 0<span>;
</span><span>14</span>     <span>$xiaKuang</span> = 0<span>;
</span><span>15</span>     <span>$zuoKuang</span> = 0<span>;
</span><span>16</span>     <span>$youKuang</span> = 0<span>;
</span><span>17</span>     <span>//</span><span>从上到下扫描</span>
<span>18</span>     <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$gao</span>; ++<span>$i</span><span>){
</span><span>19</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$kuan</span>; ++<span>$j</span><span>){
</span><span>20</span>             <span>if</span>( <span>$singleArray</span>[<span>$i</span>][<span>$j</span>] == 1<span>){
</span><span>21</span>                 <span>$dianCount</span>++<span>;
</span><span>22</span> <span>            }
</span><span>23</span> <span>        }
</span><span>24</span>         <span>if</span>(<span>$dianCount</span>>1<span>){
</span><span>25</span>             <span>$shangKuang</span> = <span>$i</span><span>;
</span><span>26</span>             <span>$dianCount</span> = 0<span>;
</span><span>27</span>             <span>break</span><span>;
</span><span>28</span> <span>        }
</span><span>29</span> <span>    }
</span><span>30</span>     <span>//</span><span>从下到上扫描</span>
<span>31</span>     <span>for</span>(<span>$i</span>=<span>$gao</span>-1; <span>$i</span> > -1; <span>$i</span>--<span>){
</span><span>32</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$kuan</span>; ++<span>$j</span><span>){
</span><span>33</span>             <span>if</span>( <span>$singleArray</span>[<span>$i</span>][<span>$j</span>] == 1<span>){
</span><span>34</span>                 <span>$dianCount</span>++<span>;
</span><span>35</span> <span>            }
</span><span>36</span> <span>        }
</span><span>37</span>         <span>if</span>(<span>$dianCount</span>>1<span>){
</span><span>38</span>             <span>$xiaKuang</span> = <span>$i</span><span>;
</span><span>39</span>             <span>$dianCount</span> = 0<span>;
</span><span>40</span>             <span>break</span><span>;
</span><span>41</span> <span>        }
</span><span>42</span> <span>    }
</span><span>43</span>     <span>//</span><span>从左到右扫描</span>
<span>44</span>     <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$kuan</span>; ++<span>$i</span><span>){
</span><span>45</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$gao</span>; ++<span>$j</span><span>){
</span><span>46</span>             <span>if</span>( <span>$singleArray</span>[<span>$j</span>][<span>$i</span>] == 1<span>){
</span><span>47</span>                 <span>$dianCount</span>++<span>;
</span><span>48</span> <span>            }
</span><span>49</span> <span>        }
</span><span>50</span>         <span>if</span>(<span>$dianCount</span>>1<span>){
</span><span>51</span>             <span>$zuoKuang</span> = <span>$i</span><span>;
</span><span>52</span>             <span>$dianCount</span> = 0<span>;
</span><span>53</span>             <span>break</span><span>;
</span><span>54</span> <span>        }
</span><span>55</span> <span>    }
</span><span>56</span>     <span>//</span><span>从右到左扫描</span>
<span>57</span>     <span>for</span>(<span>$i</span>=<span>$kuan</span>-1; <span>$i</span> > -1; --<span>$i</span><span>){
</span><span>58</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$gao</span>; ++<span>$j</span><span>){
</span><span>59</span>             <span>if</span>( <span>$singleArray</span>[<span>$j</span>][<span>$i</span>] == 1<span>){
</span><span>60</span>                 <span>$dianCount</span>++<span>;
</span><span>61</span> <span>            }
</span><span>62</span> <span>        }
</span><span>63</span>         <span>if</span>(<span>$dianCount</span>>1<span>){
</span><span>64</span>             <span>$youKuang</span> = <span>$i</span><span>;
</span><span>65</span>             <span>$dianCount</span> = 0<span>;
</span><span>66</span>             <span>break</span><span>;
</span><span>67</span> <span>        }
</span><span>68</span> <span>    }
</span><span>69</span>     <span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$xiaKuang</span>-<span>$shangKuang</span>+1;<span>$i</span>++<span>){
</span><span>70</span>         <span>for</span>(<span>$j</span>=0;<span>$j</span><<span>$youKuang</span>-<span>$zuoKuang</span>+1;<span>$j</span>++<span>){
</span><span>71</span>             <span>$rearr</span>[<span>$i</span>][<span>$j</span>] = <span>$singleArray</span>[<span>$shangKuang</span>+<span>$i</span>][<span>$zuoKuang</span>+<span>$j</span><span>];
</span><span>72</span> <span>        }
</span><span>73</span> <span>    }
</span><span>74</span>     <span>return</span> <span>$rearr</span><span>;
</span><span>75</span> }
Copy after login

Then scan from left to right to find the split of characters

Returns a three-dimensional array, each dimension is a character.

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *切割成三维数组,每个小数字在一个数组里面
</span><span> 3</span> <span> *只适用四个数字一起的数组
</span><span> 4</span> <span> *@param 经过归一化处理的二值化数组
</span><span> 5</span>  <span>*/</span>
<span> 6</span> <span>function</span> cutSmall(<span>$erzhiArray</span><span>){
</span><span> 7</span>     <span>$doubleArray</span> = <span>array</span><span>();
</span><span> 8</span>     <span>$jieZouyou</span> = <span>array</span><span>();
</span><span> 9</span>     
<span>10</span>     <span>$gao</span> = <span>count</span>(<span>$erzhiArray</span><span>);
</span><span>11</span>     <span>$kuan</span> = <span>count</span>(<span>$erzhiArray</span>['0'<span>]);
</span><span>12</span>     
<span>13</span>     <span>$jie</span> = 0<span>;
</span><span>14</span>     <span>$s</span> = 0<span>;
</span><span>15</span>     <span>$jieZouyou</span>[<span>$s</span>] = 0<span>;
</span><span>16</span>     <span>$s</span>++<span>;
</span><span>17</span>     <span>//</span><span>从左到右扫描</span>
<span>18</span>     
<span>19</span>     <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$kuan</span><span>;){
</span><span>20</span>         <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$gao</span>; ++<span>$j</span><span>){
</span><span>21</span>             <span>$jie</span> = <span>$jie</span> + <span>$erzhiArray</span>[<span>$j</span>][<span>$i</span><span>];
</span><span>22</span> <span>        }
</span><span>23</span>         <span>//</span><span>如果有一列全部是白,设置$jieZouyou,并且跳过中间空白部分</span>
<span>24</span>         <span>if</span>(<span>$jie</span> == 0<span>){
</span><span>25</span>             <span>$jieZouyou</span>[<span>$s</span>] = <span>$i</span>+1<span>;
</span><span>26</span>             <span>do</span><span>{
</span><span>27</span>                 <span>$n</span> = ++<span>$i</span><span>;
</span><span>28</span>                 <span>$qian</span> = 0<span>;
</span><span>29</span>                 <span>$hou</span> = 0<span>;
</span><span>30</span>                 <span>for</span>(<span>$m</span>=0; <span>$m</span> < <span>$gao</span>; ++<span>$m</span><span>){
</span><span>31</span>                     <span>$qian</span> = <span>$qian</span> + <span>$erzhiArray</span>[<span>$m</span>][<span>$n</span><span>];
</span><span>32</span>                     <span>$hou</span> = <span>$hou</span> + <span>$erzhiArray</span>[<span>$m</span>][<span>$n</span>+1<span>];                        
</span><span>33</span> <span>                }
</span><span>34</span>                 <span>$jieZouyou</span>[<span>$s</span>+1] = <span>$n</span>+1<span>;
</span><span>35</span> <span>            }
</span><span>36</span>             <span>//</span><span>当有两列同时全部为白,说明有间隙,循环,知道间隙没有了</span>
<span>37</span>             <span>while</span>(<span>$qian</span> == 0 && <span>$hou</span> == 0<span>);
</span><span>38</span>             <span>$s</span>+=2<span>;
</span><span>39</span>             <span>$i</span>++<span>;
</span><span>40</span>         }<span>else</span><span>{
</span><span>41</span>             <span>$i</span>++<span>;    
</span><span>42</span> <span>        }
</span><span>43</span>         
<span>44</span>         <span>$jie</span> = 0<span>;
</span><span>45</span> <span>    }
</span><span>46</span>     <span>$jieZouyou</span>[] = <span>$kuan</span><span>;
</span><span>47</span>     <span>//</span><span>极端节点数量,(应该是字符个数)*2</span>
<span>48</span>     <span>$jieZouyouCount</span> = <span>count</span>(<span>$jieZouyou</span><span>);
</span><span>49</span>     
<span>50</span>     <span>for</span>(<span>$k</span>=0;<span>$k</span><<span>$jieZouyouCount</span>/2;<span>$k</span>++<span>){
</span><span>51</span>         <span>for</span>(<span>$i</span>=0; <span>$i</span> < <span>$gao</span>; <span>$i</span>++<span>){
</span><span>52</span>             <span>for</span>(<span>$j</span>=0; <span>$j</span> < <span>$jieZouyou</span>[<span>$k</span>*2+1]-<span>$jieZouyou</span>[<span>$k</span>*2]-1; ++<span>$j</span><span>){
</span><span>53</span>                 <span>$doubleArray</span>[<span>$k</span>][<span>$i</span>][<span>$j</span>] = <span>$erzhiArray</span>[<span>$i</span>][<span>$j</span>+<span>$jieZouyou</span>[<span>$k</span>*2<span>]];
</span><span>54</span> <span>            }
</span><span>55</span> <span>        }
</span><span>56</span>         
<span>57</span> <span>    }
</span><span>58</span>     <span>return</span> <span>$doubleArray</span><span>;
</span><span>59</span> }
Copy after login

5. Tilt adjustment

We found that the third 9 is a little tilted,

We need to “rectify” the tilted image

How do people deal with it? First, they observe with their eyes "how much it is tilted", then twist the picture how much, and observe -> negative feedback -> the brain transmits the twist angle all the time, and finally the picture becomes "positive" "Come here.

How do people observe "tilt"? Taking "2" above as an example, it may be that there is more black in the upper right (lower left) than in the upper left (lower right)?

We establish a rectangular coordinate system with the X axis pointing downwards and the Y axis pointing to the right

We calculate the coordinates of the midpoint of the distribution of black points in each layer, obtain a series of discrete points, and calculate the straight lines where these points are located (calculation of linear regression equation,), the formula y = b*x+a,

I actually used this formula one day! ! !

It’s probably an inclined straight line. Calculate the inclination angle of the straight line through the straight line, and then rotate it through so many angles. The picture should be “right”.

The calculations of a and b are as follows

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *定义求线性回归A和B的函数
</span><span> 3</span> <span> *@param $zuobiaoArray坐标的三维数组
</span><span> 4</span>  <span>*/</span>
<span> 5</span> <span>function</span> getHuigui(<span>$zuobiaoArray</span><span>){
</span><span> 6</span>     <span>$y8</span> = 0<span>;
</span><span> 7</span>     <span>$x8</span> = 0<span>;
</span><span> 8</span>     <span>$x2</span> = 0<span>;
</span><span> 9</span>     <span>$xy</span> = 0<span>;
</span><span>10</span>     <span>$geshu</span> = <span>count</span>(<span>$zuobiaoArray</span><span>);
</span><span>11</span>     <span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$geshu</span>;<span>$i</span>++<span>){
</span><span>12</span>         <span>$y8</span> = <span>$y8</span>+<span>$zuobiaoArray</span>[<span>$i</span>]['y'<span>];
</span><span>13</span>         <span>$x8</span> = <span>$x8</span>+<span>$zuobiaoArray</span>[<span>$i</span>]['x'<span>];
</span><span>14</span>         <span>$xy</span> = <span>$xy</span>+<span>$zuobiaoArray</span>[<span>$i</span>]['y']*<span>$zuobiaoArray</span>[<span>$i</span>]['x'<span>];
</span><span>15</span>         <span>$x2</span> = <span>$x2</span> + <span>$zuobiaoArray</span>[<span>$i</span>]['x']*<span>$zuobiaoArray</span>[<span>$i</span>]['x'<span>];;
</span><span>16</span> <span>    }
</span><span>17</span>     <span>$y8</span> = <span>$y8</span>/<span>$geshu</span><span>;
</span><span>18</span>     <span>$x8</span> = <span>$x8</span>/<span>$geshu</span><span>;
</span><span>19</span>     
<span>20</span>     <span>$b</span> = (<span>$xy</span>-<span>$geshu</span>*<span>$y8</span>*<span>$x8</span>)/(<span>$x2</span>-<span>$geshu</span>*<span>$x8</span>*<span>$x8</span><span>);
</span><span>21</span>     <span>$a</span> = <span>$y8</span>-<span>$b</span>*<span>$x8</span><span>;
</span><span>22</span>     <span>$re</span>['a'] = <span>$a</span><span>;
</span><span>23</span>     <span>$re</span>['b'] = <span>$b</span><span>;
</span><span>24</span>     <span>return</span> <span>$re</span><span>;
</span><span>25</span>     <span>//</span><span>y = b * x + a</span>
<span>26</span> }
Copy after login

How to turn the corner?

1、可以直接对图片进行操作,但是发现有比较大的失真,就没有继续了。
Copy after login
2、或者,对黑点白点的坐标进行操作&hellip;&hellip;
Copy after login

This is trigonometric functions. I haven’t touched trigonometric functions for so long that I almost forgot about them.

Define function

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *定义转化坐标的函数
</span><span> 3</span> <span> *@param $x x坐标即$i
</span><span> 4</span> <span> *@param $y y坐标,即j
</span><span> 5</span> <span> *@param $b 线性回归方程的b参数 
</span><span> 6</span>  <span>*/</span> 
<span> 7</span> <span>function</span> getNewZuobiao(<span>$x</span>,<span>$y</span>,<span>$b</span><span>){
</span><span> 8</span>     <span>if</span>(<span>$x</span> == 0<span>){
</span><span> 9</span>         <span>if</span>(<span>$y</span>>0<span>){
</span><span>10</span>             <span>$xianJiao</span> = M_PI/2<span>;
</span><span>11</span>         }<span>elseif</span>(<span>$y</span><0<span>){
</span><span>12</span>             <span>$xianJiao</span> = -M_PI/2<span>;
</span><span>13</span>         }<span>else</span><span>{
</span><span>14</span>             <span>$p</span>['x'] = 0<span>;
</span><span>15</span>             <span>$p</span>['y'] = 0<span>;
</span><span>16</span>             <span>return</span> <span>$p</span><span>;
</span><span>17</span> <span>        }
</span><span>18</span>     }<span>else</span><span>{
</span><span>19</span>         <span>$xianJiao</span> = <span>atan</span>(<span>$y</span>/<span>$x</span><span>);    
</span><span>20</span> <span>    }
</span><span>21</span>     <span>$jiao</span> =<span>$xianJiao</span>-<span>atan</span>(<span>$b</span><span>);
</span><span>22</span>     <span>$chang</span> = <span>sqrt</span>(<span>$x</span>*<span>$x</span>+<span>$y</span>*<span>$y</span><span>);
</span><span>23</span>     <span>$p</span>['x'] = <span>$chang</span>*<span>cos</span>(<span>$jiao</span><span>);
</span><span>24</span>     <span>$p</span>['y'] = <span>$chang</span>*<span>sin</span>(<span>$jiao</span><span>);
</span><span>25</span>     <span>return</span> <span>$p</span><span>;
</span><span>26</span> }
Copy after login

Turn the corner

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *对【单个】数字的二值化二维数组进行倾斜调整
</span><span> 3</span> <span> *@param  $singleArray  高*宽的二值数组(0,1)
</span><span> 4</span>  <span>*/</span>
<span> 5</span> <span>function</span> singleSlopeAdjust(<span>$singleErzhiArray</span><span>){
</span><span> 6</span>     <span>$slopeArray</span> = <span>array</span><span>();
</span><span> 7</span>     <span>$gao</span> = <span>count</span>(<span>$singleErzhiArray</span><span>);
</span><span> 8</span>     <span>$chang</span> = <span>count</span>(<span>$singleErzhiArray</span>['0'<span>]);
</span><span> 9</span>     
<span>10</span>     <span>//</span><span>初始化$slopeArray</span>
<span>11</span>     <span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$gao</span>*4;<span>$i</span>++<span>){
</span><span>12</span>         <span>for</span>(<span>$j</span>=0;<span>$j</span><<span>$chang</span>*4;<span>$j</span>++<span>){
</span><span>13</span>             <span>$slopeArray</span>[<span>$i</span>][<span>$j</span>] = 0<span>;
</span><span>14</span> <span>        }
</span><span>15</span> <span>    }
</span><span>16</span>     
<span>17</span>     <span>//</span><span>初始化中心坐标(是数组的下标)</span>
<span>18</span>     <span>$centerXfoalt</span> = (<span>$gao</span>-1)/2<span>;
</span><span>19</span>     <span>$centerYfoalt</span> = (<span>$chang</span>-1)/2<span>;
</span><span>20</span>     <span>$centerX</span> = <span>ceil</span>(<span>$centerXfoalt</span><span>);
</span><span>21</span>     <span>$centerY</span> = <span>ceil</span>(<span>$centerYfoalt</span><span>);
</span><span>22</span>     
<span>23</span>     <span>//</span><span>初始化图片倾斜诶角度</span>
<span>24</span>     <span>/*</span><span>斜率的计算!!!!!,回归方程</span><span>*/</span>
<span>25</span>     <span>//</span><span>从上到下扫描,计算中点,求得一串坐标($i,$ava)</span>
<span>26</span>     <span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$gao</span>;<span>$i</span>++<span>){
</span><span>27</span>         <span>$Num</span> = 0<span>;
</span><span>28</span>         <span>$Amount</span> = 0<span>;
</span><span>29</span>         <span>for</span>(<span>$j</span>=0;<span>$j</span><<span>$chang</span>;<span>$j</span>++<span>){
</span><span>30</span>             <span>if</span>(<span>$singleErzhiArray</span>[<span>$i</span>][<span>$j</span>] == 1<span>){
</span><span>31</span>                 <span>$Num</span> = <span>$Num</span>+<span>$j</span><span>;
</span><span>32</span>                 <span>$Amount</span>++<span>;
</span><span>33</span> <span>            }
</span><span>34</span> <span>        }
</span><span>35</span>         <span>if</span>(<span>$Amount</span> == 0<span>){
</span><span>36</span>             <span>$Ava</span>[<span>$i</span>] = <span>$chang</span>/2<span>;    
</span><span>37</span>         }<span>else</span><span>{
</span><span>38</span>             <span>$Ava</span>[<span>$i</span>] = <span>$Num</span>/<span>$Amount</span><span>;
</span><span>39</span> <span>        }
</span><span>40</span> <span>    }
</span><span>41</span> 
<span>42</span>     
<span>43</span>     <span>//</span><span>计算线性回归方程的b与a</span>
<span>44</span>     <span>$zuo</span> = <span>array</span><span>();
</span><span>45</span>     <span>for</span>(<span>$j</span>=0;<span>$j</span><<span>count</span>(<span>$Ava</span>);<span>$j</span>++<span>){
</span><span>46</span>         <span>$zuo</span>[<span>$j</span>]['x'] = <span>$j</span><span>;
</span><span>47</span>         <span>$zuo</span>[<span>$j</span>]['y'] = <span>$Ava</span>[<span>$j</span><span>];
</span><span>48</span> <span>    }
</span><span>49</span>     <span>$res</span> = <span>$this</span>->getHuigui(<span>$zuo</span><span>);
</span><span>50</span>     <span>$zuoB</span> = <span>$res</span>['b'<span>];
</span><span>51</span> 
<span>52</span>     
<span>53</span>     <span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$gao</span>;<span>$i</span>++<span>){
</span><span>54</span>         <span>for</span>(<span>$j</span>=0;<span>$j</span><<span>$chang</span>;<span>$j</span>++<span>){
</span><span>55</span>             <span>if</span>(<span>$singleErzhiArray</span>[<span>$i</span>][<span>$j</span>] == 1<span>){
</span><span>56</span>                 <span>$splodeZuobiao</span> = <span>$this</span>->getNewZuobiao(<span>$i</span>,<span>$j</span>,<span>$zuoB</span><span>);
</span><span>57</span>                 <span>$splodeX</span> = <span>$splodeZuobiao</span>['x'<span>];
</span><span>58</span>                 <span>$splodeY</span> = <span>$splodeZuobiao</span>['y'<span>];
</span><span>59</span>                 <span>$slopeArray</span>[<span>$splodeX</span>+<span>$gao</span>][<span>$splodeY</span>+<span>$chang</span>] = 1<span>;
</span><span>60</span> <span>            }
</span><span>61</span> <span>        }
</span><span>62</span> <span>    }
</span><span>63</span>     
<span>64</span>     <span>//</span><span>将预处理的数组空白清理</span>
<span>65</span>     <span>$slopeArray</span> = <span>$this</span>->getJinsuo(<span>$slopeArray</span><span>);
</span><span>66</span>     <span>return</span> <span>$slopeArray</span><span>;
</span><span>67</span> }
Copy after login

Seeing something more positive

6. Uniform size

上文中因为各种操作,每个字符大小不一,我们需要统一大小

七、特征值的建立

有很多方法

1、逐像素特征提取法
这是一种最简单的特征提取方法。它可以对图像进行逐行逐列的扫描,当遇到黑色像素时取其特征值为1,遇到白色像素时取其特征值为0,这样当扫描结束后就获得一个维数与图像中的像素点的个数相同的特征向量矩阵。
这种方法提取的信息量最大,但是它的缺点也很明显,就是适应性不强。

2、骨架特征提取法
两幅图像由于它们的线条的粗细不同,使得两幅图像差别很大,但是将它们的线条进行细化后,统一到相同的宽度,如一个像素宽时,这是两幅图像的差距就不那么明显。利用图形的骨架作为特征来进行数码识别,就使得识别有了一定的适应性。一般使用细化的方法来提取骨架,细化的算法有很多,如Hilditch算法、Rosenfeld算法等。对经过细化的图像利用EveryPixel函数进行处理就可以得到细化后图像的特征向量矩阵。骨架特征提取的方法对于线条粗细不同的数码有一定的适应性,但是图像一旦出现偏移就难以识别。

3、微结构法
微结构法将图像分为几个小块,统计每个小块的像素分布。本文提取出汉字的39个特征,存储在数组f[0]~f[38]中。具体算法可分为四步:

步骤一:把字符平均分成9份,如图4.1所示,给每一份编号如图4.2,统计每一份内黑色像素的个数,存储在数字tz[0]~tz[9]中,统计在行方向和列方向上每一份内的黑色像素个数和与之相邻的一份内黑色像素个数的比值作为一个特征,例如:行方向上提取特征f[0]=tz[1]/ tz[0],f[1]=tz[2]/ tz[1],f[2]=tz[0]/ tz[2],…,f[8]=tz[6]/ tz[8];列方向上f[9]=tz[3]/ tz[0],f[10]=tz[6]/ tz[3],f[11]=tz[0]/ tz[6],…,f[17]=tz[2]/ tz[8],共18个特征。

步骤二:把字符横向分成三份,如图4.3所示,统计每一份内的黑色像素个数,每一份内的黑色像素个数与前一份内黑色像素个数的比值作为一个特征,f[18]=tz[10]/ tz[9],f[19]=tz[11]/ tz[10],f[20]=tz[9]/ tz[11];把字符纵向分成三份,如图4.4所示,统计每一份内的黑色像素个数,每一份内的黑色像素个数与前一份内黑色像素个数的比值作为一个特征,f[21]=tz[13]/ tz[12],f[22]=tz[14]/ tz[13],f[23]=tz[12]/ tz[14];共六个特征。

步骤三:如图4.5,在竖直方向上找出三列,统计在该列中跳变点的个数,即相邻点像素值从0变到255的次数,共三个特征,记为f[24],f[25],f[26];在水平方向上找出三行列,统计在该行中跳变点的个数,即相邻点象素值从0变到255的次数,共三个特征,记为f[27],f[28],f[29]。

图4.5

步骤四:把每一份内黑色象素的个数tz[0]~tz[9],作为9个特征,记为:f[30]~f[38]。

这样得到汉字的共39个特征,根据这些特征就可以区分每个车牌汉字,进行识别。

我们使用最简单的逐像素特征提取法。

多多增加数据库,识别率会增加的

八、识别验证码

对于一个新的验证码,进行上文操作,然后对比数据库就可以了

<span> 1</span> <span>/*</span>
<span> 2</span> <span> *进行匹配
</span><span> 3</span> <span> *@param  $Image  图片路径
</span><span> 4</span>  <span>*/</span>
<span> 5</span> <span>public</span> <span>function</span> run(<span>$Image</span><span>){
</span><span> 6</span>     <span>$data</span> = <span>array</span>('','','',''<span>);
</span><span> 7</span>     <span>$result</span>=""<span>;
</span><span> 8</span>     <span>$bilu</span> = ''<span>;
</span><span> 9</span>     <span>$maxarr</span> = ''<span>;
</span><span>10</span>     
<span>11</span>     <span>//</span><span>提取特征</span>
<span>12</span>     <span>$this</span>->prepare(<span>$Image</span><span>);
</span><span>13</span>     <span>$yuanshi</span> = <span>$this</span>-><span>getErzhi();
</span><span>14</span>     <span>$yijijiangzao</span> = <span>$this</span>->reduceZao(<span>$yuanshi</span><span>);
</span><span>15</span>     <span>$small</span> = <span>$this</span>->cutSmall(<span>$yijijiangzao</span><span>);
</span><span>16</span>     <span>for</span>(<span>$k</span>=0;<span>$k</span><4;<span>$k</span>++<span>){
</span><span>17</span>         <span>$tianchong</span> = <span>$this</span>->tianChong(<span>$small</span>[<span>$k</span><span>]);
</span><span>18</span>         <span>$tiaozhenjiaodu</span> = <span>$this</span>->singleSlopeAdjust(<span>$tianchong</span><span>);
</span><span>19</span>         <span>$tongyidaxiao</span> = <span>$this</span>->tongyiDaxiao(<span>$tiaozhenjiaodu</span><span>);
</span><span>20</span>         <span>for</span>(<span>$i</span>=0;<span>$i</span><20;<span>$i</span>++<span>){
</span><span>21</span>             <span>for</span>(<span>$j</span>=0;<span>$j</span><20;<span>$j</span>++<span>){
</span><span>22</span>                 <span>$data</span>[<span>$k</span>] .= <span>$tongyidaxiao</span>[<span>$i</span>][<span>$j</span><span>];    
</span><span>23</span> <span>            }    
</span><span>24</span> <span>        }
</span><span>25</span> <span>    }
</span><span>26</span> 
<span>27</span>     <span>//</span><span> 进行关键字匹配</span>
<span>28</span>     <span>foreach</span>(<span>$data</span> <span>as</span> <span>$numKey</span> => <span>$numString</span><span>)
</span><span>29</span> <span>    {
</span><span>30</span> 
<span>31</span>         <span>$max</span> = 0<span>;
</span><span>32</span>         <span>$num</span> = 0<span>;
</span><span>33</span>         <span>foreach</span>(<span>$this</span>->Keys <span>as</span> <span>$value</span> => <span>$key</span><span>)
</span><span>34</span> <span>        {
</span><span>35</span>             <span>similar_text</span>(<span>$value</span>, <span>$numString</span>,<span>$percent</span><span>);
</span><span>36</span>             <span>if</span>(<span>$percent</span> > <span>$max</span><span>)
</span><span>37</span> <span>            {
</span><span>38</span>                 <span>$max</span> = <span>$percent</span><span>;
</span><span>39</span>                 <span>$num</span> = <span>$key</span><span>;
</span><span>40</span>                 <span>$zim</span> = <span>$value</span><span>;
</span><span>41</span> <span>            }
</span><span>42</span>             <span>if</span>(<span>$max</span>>95<span>){
</span><span>43</span>                 <span>break</span><span>;
</span><span>44</span> <span>            }
</span><span>45</span> <span>        }
</span><span>46</span>         <span>$result</span> .=<span>$num</span><span>;
</span><span>47</span>         <span>$maxarr</span>[] = <span>$max</span><span>;
</span><span>48</span> <span>    }
</span><span>49</span>     <span>//</span><span> 查找最佳匹配数字</span>
<span>50</span>     <span>$re</span> = <span>$maxarr</span><span>;
</span><span>51</span>     <span>$re</span>[] = <span>$result</span><span>;
</span><span>52</span>     <span>return</span> <span>$re</span><span>;
</span><span>53</span>     <span>//</span><span>return $result.'|max|一:'.$maxarr['0'].'|二:'.$maxarr['1'].'|三:'.$maxarr['2'].'|四:'.$maxarr['3'];</span>
<span>54</span> }
Copy after login

 

试试:

 

PHP图形验证码识别

Header("Content-type: image/gif");
/*
* Initialization
*/
$border = 0; //Do you want Border 1 requires: 0 but not
$how = 4; //Number of verification code digits
$w = $how*15; //Picture width
$h = 20; //Picture height
$fontsize = 5; //Font size
$alpha = "abcdefghijkmnopqrstuvwxyz"; //Verification code content 1: Letters
$number = "023456789"; //Verification code content 2: Numbers
$randcode = ""; //Verification code string initialization
srand((double)microtime()*1000000); //Initialization random number seed

$im = ImageCreate($w, $h); //Create verification image

/*
* Draw basic frame
*/
$bgcolor = ImageColorAllocate($im, 255, 255, 255); //Set background color
ImageFill($im, 0, 0, $bgcolor); //Fill background color
if($border)
{
$black = ImageColorAllocate($im, 0, 0, 0); / /Set border color
ImageRectangle($im, 0, 0, $w-1, $h-1, $black);//Draw border
}

/*
* Generate random characters bit by bit
*/
for($i=0; $i<$how; $i++)
{
$alpha_or_number = mt_rand(0, 1); //The letters are still Number
$str = $alpha_or_number ? $alpha : $number;
$which = mt_rand(0, strlen($str)-1); //Which character to take
$code = substr($str , $which, 1); //Get the character
$j = !$i ? 4 : $j+15; //Draw the character position
$color3 = ImageColorAllocate($im, mt_rand(0,100), mt_rand (0,100), mt_rand(0,100)); //Character random color
ImageChar($im, $fontsize, $j, 3, $code, $color3); //Draw character
$randcode .= $ code; //Add verification code string bit by bit
}

/*
* Add interference
*/
for($i=0; $i<5; $ i++)//Draw background interference line
{
$color1 = ImageColorAllocate($im, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255)); //Interference line color
ImageArc($ im, mt_ra...the rest of the text>>

PHP verification code recognition or ASP program can also be used to write program recognition

The principle is not difficult, just generate an image through PHP! Just use PHP's image processing function to write a few characters on this picture and you're good to go! When writing characters, pay attention to recording the written characters. This recording is done through session! Then just call the $_SESSION variable directly during verification!

The specific code is as follows:
There are two files
yangzhengma.php used to display images and verify the input verification code

session_start() ;
if(!empty($_GET['sub'])){
if($_SESSION['checks'] == $_GET['ma']){
echo "Verification code is correct
";
}else{
echo "The verification code is incorrect!
";
}
}
?>
< ;html>

<br> Verification code example<br>







Please enter the verification code:





Note that the address of the image is written to the file address of the image generated by PHP

check.php is used to generate the image

session_start();
header('content-type:image/jpeg');
$image_width=70;
$image_height=25;
$str="";
$arr =array(1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G',' H','I','J','K','L','M','N','P','Q','R','S','T','U' ,'V','W','X','Y','Z');
for ($i =0; $i...the rest of the full text>>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/857272.htmlTechArticlePHP verification code identification, php verification code first recommend a few articles about verification code identification, I think it is a good php implementation Recognition of verification code (primary article) About bp neural grid identification of verification code 1. Thoughts...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template