-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotter.php
More file actions
executable file
·50 lines (30 loc) · 2.8 KB
/
Copy pathplotter.php
File metadata and controls
executable file
·50 lines (30 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
$text = 'x55.8491828745511 y69.8328831802344 X536.870290874195 Y69.8524320830581|x75.9672648695454 y182.152776682671 X556.986605964601 Y182.137565293073|x67.1744240005578 y313.346216307261 X548.084947994217 Y313.35890375553|x25.195734398672 y537.197322597688 X506.193395831051 Y537.183287641071|x76.5539199454828 y639.198128023749 X557.444968348856 Y639.101040796454|x192.203623446673 y131.786955617723 X673.334503524637 Y131.801740403726|x128.101989461389 y267.061387929875 X609.096279650192 Y267.088980872817|x142.160206921616 y383.104988688373 X623.147446737923 Y382.935780436804|x175.826288875711 y523.125839640252 X656.812999792254 Y523.103270814218|x132.912935952457 y700.460465364132 X614.017204413653 Y700.500217475432|x219.938902573327 y19.625961227226 X700.958125095033 Y19.7557620382655|x264.715351631766 y169.020052823759 X745.744454592815 Y169.017269067444|x262.923733097701 y373.343812937098 X744.046026806277 Y373.34035476574|x238.105054446118 y463.321353707034 X719.101024654044 Y463.301050022406|x271.99092320867 y634.833136379578 X752.983233610277 Y634.830264042724|x324.256126451898 y97.808212134409 X805.53391585495 Y97.7721811809243|x361.716140303534 y168.142276446355 X842.738777235915 Y168.079542633831|x357.869093228952 y418.672545193802 X838.879949206496 Y418.704518934702|x353.681174140111 y531.316740010021 X834.712763291614 Y531.315604561945|x344.245703447083 y624.909882779116 X825.256306777452 Y624.911848712066|x443.924322292719 y23.7891604472867 X924.876903273753 Y23.7739982893845|x458.440196080179 y160.095796532001 X940.025537882718 Y160.142311213305|x426.705281619995 y424.520299808683 X907.664948645503 Y424.547492594095|x441.419994274322 y467.3275905657 X922.520659646273 Y467.319831377502|x382.320191709458 y684.377167328522 X863.429124172011 Y684.345546198641';
$controlPoints = explode("|", $text);
$image1 = imagecreatefromjpeg("bin/abc/img2.jpg");
$image2 = imagecreatefromjpeg("bin/abc/img1.jpg");
$ellipseColor = imagecolorallocate($image1, 255, 0, 0);
//print_r($controlPoints);
// Output the image.
foreach($controlPoints as $cp){
$pts = explode(" ", $cp);
$ax1 = explode(",", $pts[0]);
$bx1 = explode(",", $pts[1]);
$ax2 = explode(",", $pts[2]);
$bx2 = explode(",", $pts[3]);
// print_r($ax1);
// print_r($bx1);
// print_r($ax2);
// print_r($bx2);
$x1 = (int) substr($ax1[0], 1);
$y1 = (int) substr($bx1[0], 1);
$x2 = (int) substr($ax2[0], 1);
$y2 = (int) substr($bx2[0], 1);
echo "$x1, $y1 - $x2, $y2";
echo "<br>";
imagefilledellipse($image1, $x1, $y1, 20, 20, $ellipseColor);
imagefilledellipse($image2, $x2, $y2, 20, 20, $ellipseColor);
}
imagejpeg($image1, "VisualLogs/img1.jpg");
imagejpeg($image2, "VisualLogs/img2.jpg");
?>