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 )){