HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/chart24/CC24report.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Camera Check</title>
</head>

<body class="oneColElsCtr">
<?php
$sum=260;
$check=1;
$dtime=time();



//$dStr=substr($dtime,7,9)."-";


	echo "Camera profile Checking form! " .  "<br />";
    
	    $upcc24="upload/" .$f123;
		$upicc="upload/" .$icc;

	   echo "Report start: " .  "<br />";
     // echo "Stored in: " . "upload/" . $_FILES["file"]["name"]. "<br />";
	 $filename=substr($f123,0,-4);
	 //$iccname=$dStr."-".$_FILES["iccfile"]["name"];

	 
	exec("echo . | convert ". $upcc24." info:".$filename.".txt"); 
	
	sleep(2);

	  	  $contents = file($filename.".txt");
		 $string = implode($contents);

$dot = explode(" ", $string);
//print_r ($dot);

$pdot = explode("x", $dot[2]);
//print_r ($pdot);

$xpix=$pdot[0];
$ypix=$pdot[1];

$p1x=round(($pdot[0]/12),0)*1;
$p2x=round(($pdot[0]/12),0)*3;
$p3x=round(($pdot[0]/12),0)*5;
$p4x=round(($pdot[0]/12),0)*7;
$p5x=round(($pdot[0]/12),0)*9;
$p6x=round(($pdot[0]/12),0)*11;

$p1y=round(($pdot[1]/8),0)*1;
$p2y=round(($pdot[1]/8),0)*3;
$p3y=round(($pdot[1]/8),0)*5;
$p4y=round(($pdot[1]/8),0)*7;

//echo "<br>x1y1:".$p1x."x".$p1y."<br>";
//echo "x6y4:".$p6x."x".$p4y."<br>";

//echo "echo . | convert ". $upcc24."[1x1+".$p1x."+".$p1y."]  -format '%[fx:int(255*r)] info:".$filename."p.txt"; 
//exec ("echo . | convert ". $upcc24."[1x1+".$p1x."+".$p1y."]  info:".$filename."p.txt"); 
	//echo "echo . | convert ". $upcc24."[1x1+".$p1x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p.txt";
	
	exec("echo . | convert ". $upcc24."[1x1+".$p1x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p1.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p2x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p2.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p3x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p3.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p4x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p4.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p5x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p5.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p6x."+".$p1y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p6.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p1x."+".$p2y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p7.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p2x."+".$p2y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p8.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p3x."+".$p2y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p9.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p4x."+".$p2y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p10.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p5x."+".$p2y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p11.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p6x."+".$p2y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p12.txt"); 	
	exec("echo . | convert ". $upcc24."[1x1+".$p1x."+".$p3y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p13.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p2x."+".$p3y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p14.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p3x."+".$p3y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p15.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p4x."+".$p3y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p16.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p5x."+".$p3y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p17.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p6x."+".$p3y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p18.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p1x."+".$p4y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p19.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p2x."+".$p4y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p20.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p3x."+".$p4y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p21.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p4x."+".$p4y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p22.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p5x."+".$p4y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p23.txt"); 
	exec("echo . | convert ". $upcc24."[1x1+".$p6x."+".$p4y."] -format %[fx:int(255*r)],%[fx:int(255*g)],%[fx:int(255*b)]  info:".$filename."p24.txt"); 	
	
	
	sleep(2);


	
	
$myFile =$filename."px.txt";
//$icclab="upload/".$filename."T.ti1";
$fh = fopen($myFile, 'w') or die("can't open file");
//fwrite($fh, $p);


$viHead='CGATS.17
ORIGINATOR	"icctrans"
#
# Data follows
#
NUMBER_OF_SETS	24
NUMBER_OF_FIELDS	4
BEGIN_DATA_FORMAT
SAMPLE_ID	RGB_R	RGB_G	RGB_B
END_DATA_FORMAT
BEGIN_DATA
';	

fwrite($fh, $viHead);

for ( $j = 1; $j <= 24; $j+= 1) {

$line=$j."	";
fwrite($fh, $line);

	$contents = file($filename."p".$j.".txt");
	$string = implode($contents);
	$p = ereg_replace(",", "	", $string);
	fwrite($fh, $p);
	  }


$viTail='END_DATA';

fwrite($fh, $viTail);	  
fclose($fh);

//echo "<br>icctrans -v -i ".$upicc." -o *Lab -t 3 ".$dStr."-CC24px.txt ".$dStr."-cc24lab.txt";
exec("echo . |icctrans -v -i ".$upicc." -o *Lab -t 3 ".$myFile." ".$filename."lab.txt"); 

	  


function get_between ($text, $s1, $s2) {
$mid_url = "";
$pos_s = strrpos($text,$s1);
$pos_e = strrpos($text,$s2);
for ( $i=$pos_s+strlen($s1) ; (( $i<($pos_e)) && $i < strlen($text)) ; $i++ ) {
$mid_url .= $text[$i];
}
return $mid_url;
}

$contents = file($filename."lab.txt");
$string = implode($contents);	
$p = str_replace(' ','', $string );
$p = str_replace('	',',', $p );
$p = str_replace(chr(13).chr(10),',', $p );
$datastring0=get_between($p,"BEGIN_DATA,",",END_DATA");
$dot = explode(",", $datastring0);
//print_r($dot);	


$contentsT = file("SG24.txt");
$stringt = implode($contentsT);	
$pt = str_replace(' ','', $stringt );
$pt = str_replace('	',',', $pt );
$pt = str_replace(chr(13).chr(10),',', $pt );
$datastringt=get_between($pt,"BEGIN_DATA,",",END_DATA");
$dotT = explode(",", $datastringt);
print_r($dotg);	
	
	
function de94($l1,$a1,$b1,$l2,$a2,$b2) {
  $cp=SQRT(pow($a1,2)+pow($b1,2));
  $ctp=SQRT(pow($a2,2)+pow($b2,2));
  $d76=sqrt(pow(($l1-$l2),2)+ pow(($a1-$a2),2)+pow(($b1-$b2),2));
  $dph=SQRT(ABS(pow($d76,2)-pow(($l1-$l2),2)-pow((SQRT(pow($a1,2)+pow($b1,2))-SQRT(pow($a2,2)+pow($b2,2))),2)));
  $dcp=$ctp-$cp;
  $d94=SQRT((pow((($l1-$l2)/(1*1)),2))+pow(($dcp/(1*(1+(0.045*$cp)))),2)+ pow(($dph/(1*(1+(0.015*$cp)))),2));
  return round($d94,2);
} 

?> 
<table width="200" border="1" align="center">
<tr align='center'>
  <td align='center'>編號</td>
  <td colspan="3">相機色彩值</td>
  <td colspan="3">目標值</td>
  <td>色差</td>
<tr align='center'>
<td align='center'>NO</td><td>RL</td><td>Ra</td><td>Rb</td><td>TL</td><td>Ta</td><td>Tb</td><td>dE(94)</td>

<?php
$TT76=0;
$max76=0;
$max1=0;
$max2=0;
$sum=0;
$i=1;
for ( $j = 0; $j <= 23; $j+= 1) {
$L = $dot[$i+($j*4)];
$a = $dot[$i+1+($j*4)];
$b = $dot[$i+2+($j*4)];

$Lt = $dotT[$i+($j*4)];
$at = $dotT[$i+1+($j*4)];
$bt = $dotT[$i+2+($j*4)];

$no=$j+1;

$de76r=de94($L,$a,$b,$Lt,$at,$bt);
$sum=$de76r+$sum;
echo "<tr align='right'><td>".$no."</td><td>".round($L,2)."</td><td>".round($a,2)."</td><td>".round($b,2)."</td><td>".$Lt."</td><td>".$at."</td><td>".$bt."</td><td>";
if ($de76r>2) {
echo "<font color='red'>";}
else {"<font color='black'>";}
echo $de76r."</td></tr>";

$TT76=$de76r+$TT76;
$max1=max($max1,$de76r);

$max76=max($max1,$de76r);
}
$summ=100-$sum;
echo "<tr><td>Avg</td><td>".round(($TT76/24),2)."</td><td>Max</td><td>".$max76."</td>";

?>
 <td> score </td><td><?php echo $summ;?></td></tr>
</table>

<table width="200" border="1" align="center">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8"







require_once ('../jpgraph/jpgraph.php');
require_once ('../jpgraph/jpgraph_scatter.php');

//unlink('targetrgb.ti3');
unlink('scatterGu.png');
//unlink('scatterGuF.png');
//unlink('scatterGuA.png');

$datax = array($dotT[34],$dotT[58],$dotT[26],$dotT[46],$dotT[62],$dotT[42],$dotT[54],$dotT[22],$dotT[70],$dotT[30],$dotT[50],$dotT[38],$dotT[66],$dotT[34]);//SG24
$datay = array($dotT[35],$dotT[59],$dotT[27],$dotT[47],$dotT[63],$dotT[43],$dotT[55],$dotT[23],$dotT[71],$dotT[31],$dotT[51],$dotT[39],$dotT[67],$dotT[35]);

$datax2 = array($dot[34],$dot[58],$dot[26],$dot[46],$dot[62],$dot[42],$dot[54],$dot[22],$dot[70],$dot[30],$dot[50],$dot[38],$dot[66],$dot[34]);//Sample
$datay2 = array($dot[35],$dot[59],$dot[27],$dot[47],$dot[63],$dot[43],$dot[55],$dot[23],$dot[71],$dot[31],$dot[51],$dot[39],$dot[67],$dot[35]);


$graph = new Graph(600,600);
$graph->img->SetMargin(40,40,40,40);	
$graph->img->SetAntiAliasing();
$graph->SetScale("linlin");
$graph->SetShadow();
$graph->title->Set("SG24 in Red"); 
$graph->title->SetFont(FF_FONT1,FS_BOLD);
$graph->SetBackgroundImage("lab.png",BGIMG_FILLFRAME);

//$sp1->SetColor("#55bbdd");
//$sp1->SetLegend('Line 1');
$sp1 = new ScatterPlot($datay,$datax);
$sp1->SetLinkPoints(true,"red",2);
$sp1->mark->SetType(MARK_FILLEDCIRCLE);
$sp1->mark->SetFillColor("red");
$sp1->mark->SetWidth(3);


$sp2 = new ScatterPlot($datay2,$datax2);
$sp2->SetLinkPoints(true,"#55bbdd",2);
$sp2->mark->SetType(MARK_FILLEDCIRCLE);
$sp2->mark->SetFillColor("#55bbdd");
$sp2->mark->SetWidth(3);



$graph->Add($sp1);
$graph->Add($sp2);


//$graph->Stroke();

$graph->Stroke('scatterGu.png');

for ( $j = 1; $j <= 24; $j+= 1) {
unlink($filename."p".$j.".txt");
}
unlink($filename.".txt");
unlink($filename."px.txt");
unlink($filename."lab.txt");


?>
<img src="scatterGu.png">
</div></td></tr>
</table>

<table width="200" border="1" align="center">
<tr>
<td><div align="center">
<?php // content="text/plain; charset=utf-8" 
//require_once ('jpgraph/jpgraph.php');
require_once ('../jpgraph/jpgraph_line.php');


unlink('scatterDR.png');
$datay1 = array($dotT[93],$dotT[89],$dotT[85],$dotT[81],$dotT[77],$dotT[73]);

$datay2 = array($dot[93],$dot[89],$dotT[85],$dot[81],$dot[77],$dot[73]);




// Setup the graph
$graph = new Graph(550,430);
$graph->SetScale("textlin");

$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);

$graph->title->Set('Dynamic Range');
$graph->SetBox(false);

$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);

$graph->xaxis->SetTickLabels(array('0','5','10','20','30','40','50','60','70','80','90','95','100'));
$graph->ygrid->SetFill(false);
//$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);

$p1 = new LinePlot($datay1);
$graph->Add($p1);

$p2 = new LinePlot($datay2);
$graph->Add($p2);
$ADR=$b16l-$a16l;
$BDR=$bt16l-$at16l;

$p1->SetColor("green");
$p1->SetLegend('SG24 DR');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('green');
$p1->mark->SetFillColor('green');
$p1->SetCenter();

$p2->SetColor("#aaaaaa");
$p2->SetLegend('Sample DR');
$p2->mark->SetType(MARK_UTRIANGLE,'',1.0);
$p2->mark->SetColor('#aaaaaa');
$p2->mark->SetFillColor('#aaaaaa');
$p2->value->SetMargin(14);
$p2->SetCenter();

$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);


// Output line
$graph->Stroke('scatterDR.png');
?>
<img src="scatterDR.png">
</div></td></tr>
</table>


<tr>

<br />
<td align="center"><font size="-2"> &copy; <a href="mailto:[email protected]">Fred Kuo</a>, 2010. All rights reserved.<br><a href="http://www.fredkuo.idv.tw/wordpress/?p=1025">Read more.</a><br>
</td>


</tr>
</body>


</html>