Which of the following code is wrong on the Internet?

Source: Internet
Author: User
Where is a piece of code on the Internet wrong? & Lt ;? Php/** & nbsp; * & nbsp; telephone number recognition. & nbsp; * & nbsp; @ author & nbsp; by & nbsp; zsc & nbsp; for & nbsp; 2010.03.24 & nbsp; */& nbsp; class & nbsp; gjPhone {& nbsp; p where is a piece of code on the Internet wrong?
 /**
* Telephone number recognition.
* @ Author by zsc for 2010.03.24
*/
 
Class gjPhone {
Protected $ imgPath; // Image path
Protected $ imgSize; // Image size
Protected $ hecData; // isolated array
Protected $ horData; // horizontally organized data
Protected $ verData; // vertically sorted data
 
Function _ construct ($ path ){
$ This-> imgPath = $ path;
}
/**
* Color separation conversion...
*
* @ Param unknown_type $ path
* @ Return unknown
*/
Public function getHec ()
{
$ Size = getimagesize ($ this-> imgPath );
$ Res = imagecreatefrompng ($ this-> imgPath );
For ($ I = 0; $ I <$ size [1]; ++ $ I)
{
For ($ j = 0; $ j <$ size [0]; ++ $ j)
{
$ Rgb = imagecolorat ($ res, $ j, $ I );
$ Rgbarray = imagecolorsforindex ($ res, $ rgb );
If ($ rgbarray ['red'] <125 | $ rgbarray ['green'] <125
| $ Rgbarray ['blue'] <125)
{
$ Data [$ I] [$ j] = 1;
} Else {
$ Data [$ I] [$ j] = 0;
}
}
}
$ This-> imgSize = $ size;
$ This-> hecData = $ data;
}
/**
* Horizontal sorting of data after color separation...
*
* @ Return unknown
*/
Public function magHorData ()
{
 
$ Data = $ this-> hecData;
$ Size = $ this-> imgSize;
$ Z = 0;
For ($ I = 0; $ I <$ size [1]; ++ $ I)
{
If (in_array ('1', $ data [$ I]) {
$ Z ++;
For ($ j = 0; $ j <$ size [0]; ++ $ j)
{
If ($ data [$ I] [$ j] = '1 '){
$ Newdata [$ z] [$ j] = 1;
} Else {
$ Newdata [$ z] [$ j] = 0;
}
}
}
 
}
Return $ this-> horData = $ newdata;
}
/**
* Sort the vertical data...
*
* @ Return unknown
*/
Public function magVerData ($ newdata ){
For ($ I = 0; $ I <132; ++ $ I ){
For ($ j = 1; $ j <13; ++ $ j ){
$ Ndata [$ I] [$ j] = $ newdata [$ j] [$ I];
}
}
 
 
$ Sum = count ($ ndata );
$ C = 0;
For ($ a = 0; $ a <$ sum; $ a ++ ){
$ Value = $ ndata [$ a];
If (in_array (1, $ value )){

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.