What's wrong with a piece of code on the Internet?

Source: Internet
Author: User
What's wrong with a piece of code online?
 /**
* Phone number identification.
* @author by ZSC for 2010.03.24
*/

Class gjphone{
protected $imgPath;//Picture path
protected $imgSize;//Picture size
protected $hecData;//Array after separation
protected $horData;//horizontal finishing of data
protected $verData;//Data in portrait arrangement

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 '] < | | $rgbarray [' green ']<125
|| $rgbarray [' Blue '] < 125)
{
$data [$i] [$j]=1;
}else{
$data [$i] [$j]=0;
}
}
}
$this->imgsize = $size;
$this->hecdata = $data;
}
/**
* Color separation after the data horizontal finishing ...
*
* @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;
}
/**
* Organize longitudinal 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.