Example #1
0
<?php

//////////////////////
$sroot = "/mntL/group/group3";
include $sroot . "/matlab/functions.php";
$imgdir = $sroot . "/i/";
//////////////////////
$result = matlab("doImageAnalysis('" . $imgdir . "')");
//$result = shell_exec("matlab -r \"add('hello','world')\" -nodisplay");
echo $result;
Example #2
0
$vori = $_POST['vori'];
// Data vars
$eid = $_POST['eid'];
$bowtype = $_POST['bowtype'];
$distance = $_POST['distance'];
$target = $_POST['target'];
//////////////////////
$shots = "";
foreach ($_FILES['files']['tmp_name'] as $file) {
    if ($vori == "i") {
        $func = "doImageAnalysis " . $file;
    } else {
        $func = "doVideoAnalysis " . $file;
    }
    // CALLS MATLAB PROGRAM
    $shots .= matlab($func);
    // TEMPORARY FAKE DATA THAT DODGES THE MATLAB PROGRAM COMPLETELY
    /*$scorelength = 12;
    		$posscores = array("0","1","2","3","4","5","6","7","8","9","10","X");
    		for ($i = 0; $i < $scorelength; $i++) {
    			$tmpscore = $posscores[rand(0, count($posscores)-1)];
    			if ($tmpscore != "X") {$tmpscore = round(($tmpscore+10)/2);}
    			$tmpangle = rand(0, 359);
    			$shots .= $_SESSION['uid'].":".$tmpscore.":".$tmpangle.";";
    		}*/
}
echo $shots;
// Split rounds
$shotarr = array_filter(explode(";", $shots));
$con = connect();
// Create a round