|
|
|
|
|
<!DOCTYPE html> |
|
|
<html> |
|
|
<head> |
|
|
<meta http-equiv="cache-control" |
|
|
content="max-age=0" /> |
|
|
<meta http-equiv="cache-control" |
|
|
content="no-store" /> |
|
|
<meta http-equiv="expires" |
|
|
content="-1" /> |
|
|
<meta http-equiv="expires" |
|
|
content="Tue, 01 Jan 1980 1:00:00 GMT" /> |
|
|
<meta http-equiv="pragma" |
|
|
content="no-cache" /> |
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
|
|
<!--meta http-equiv="refresh" content="300" />--> <!--Refresh each 5s--> |
|
|
<meta charset="utf-8" /> |
|
|
|
|
|
<link rel="icon" type="image/png" href="favicon.ico"> |
|
|
<style> |
|
|
|
|
|
body, html { |
|
|
font-family: "Arial"; |
|
|
} |
|
|
|
|
|
.titlebox { |
|
|
float: left; |
|
|
padding: 0 5px; |
|
|
margin: -30px 0 0 20px; |
|
|
background: #fff; |
|
|
} |
|
|
|
|
|
.div-relative { |
|
|
position: relative; |
|
|
color: #000000; |
|
|
width: 480px; |
|
|
height: 320px; |
|
|
} |
|
|
|
|
|
.div-a { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-b { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-c { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
|
|
|
.div-d { |
|
|
position: absolute; |
|
|
width: 100%; /*480*/ |
|
|
height: 320px; /*320*/ |
|
|
/*transform: scale(0.85);*/ /* Equal to scaleX(0.7) scaleY(0.7) */ |
|
|
} |
|
|
</style> |
|
|
|
|
|
<!--meta http-equiv="refresh" content="300" />--> <!--Refresh each 5s--> |
|
|
|
|
|
<title>AI Engine</title> |
|
|
|
|
|
<script src="jquery_3_2_1.min.js"></script> |
|
|
<script src="fabric_jquery.easyui.min_compressed_on_nvr.js"></script> |
|
|
<script src="config.js"></script> |
|
|
<script> |
|
|
|
|
|
window.onerror = function (message, url, linenumber) { |
|
|
if (url.search("fabric_jquery.easyui.min_compressed_on_nvr.js") >= 1) { |
|
|
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("slider") >= 1) { |
|
|
loadScript("fabric_jquery.easyui.min_compressed_on_nvr.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (message.search("myport") >= 1) { |
|
|
loadScript("config.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("config.js") >= 1) { |
|
|
loadScript("config.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("jquery_3_2_1.min.js") >= 1) { |
|
|
loadScript("jquery_3_2_1.min.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("cookie.min.js") >= 1) { |
|
|
loadScript("cookie.min.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("object_index.js") >= 1) { |
|
|
loadScript("object_index.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("lang.js") >= 1) { |
|
|
loadScript("lang.js", function () { |
|
|
}); |
|
|
} |
|
|
else if (url.search("lang_cookie.js") >= 1) { |
|
|
loadScript("lang_cookie.js", function () { |
|
|
}); |
|
|
} |
|
|
else { |
|
|
//location.reload(); |
|
|
var replaceUrl = 'http://' + window.location.hostname + ':' + GetUrlPort() + '/Aida/object_index.html'; |
|
|
//alert(replaceUrl); |
|
|
window.location.replace(replaceUrl); |
|
|
} |
|
|
} |
|
|
function GetUrlPort() { |
|
|
var url_href = window.location.href; |
|
|
var arr_url = url_href.split(":")[2].split("/")[0]; |
|
|
|
|
|
return arr_url; |
|
|
} |
|
|
if (window.history.replaceState) { |
|
|
window.history.replaceState(null, null, window.location.href); |
|
|
} |
|
|
</script> |
|
|
<script src="cookie.min.js"></script> |
|
|
|
|
|
<script src="object_index.js"></script> |
|
|
|
|
|
<script src="lang.js"></script> |
|
|
|
|
|
<script src="lang_cookie.js"></script> |
|
|
<link rel="stylesheet" type="text/css" href="bootstrap.min.css"> |
|
|
|
|
|
<link rel="stylesheet" type="text/css" href="easyui.css"> |
|
|
|
|
|
<script> |
|
|
|
|
|
var g_Canvas_BackgroundImage = null; |
|
|
var g_h = -1; |
|
|
var g_m = -1; |
|
|
var g_s = -1; |
|
|
var g_ms = -1; |
|
|
|
|
|
/* |
|
|
function update_canvas() { |
|
|
clearInterval(g_Canvas_BackgroundImage); |
|
|
g_Canvas_BackgroundImage = setInterval(function () { |
|
|
var win_width = G_VIEW_CANVAS_X, win_height = G_VIEW_CANVAS_Y; |
|
|
|
|
|
var NowDate = new Date(); |
|
|
var h = NowDate.getHours(); |
|
|
var m = NowDate.getMinutes(); |
|
|
var s = NowDate.getSeconds(); |
|
|
var ms = NowDate.getMilliseconds(); |
|
|
|
|
|
|
|
|
if (g_h == -1 || g_m == -1 || g_s == -1 || g_ms == -1) { |
|
|
g_h = h; |
|
|
g_m = m; |
|
|
g_s = s; |
|
|
g_ms = ms; |
|
|
} |
|
|
|
|
|
var imgUrl = 'http://' + window.location.hostname + ":" + GetUrlPort() + '/Aida/images/gray_background.png'; |
|
|
|
|
|
try { |
|
|
fabric.Image.fromURL(imgUrl, function (img) { |
|
|
|
|
|
if (img != null && img._element != null) { |
|
|
|
|
|
if ((h * 3600 + m * 60 + s + ms / 1000) > (g_h * 3600 + g_m * 60 + g_s + g_ms / 1000)) { |
|
|
img.set({ |
|
|
scaleX: win_width / img.width, |
|
|
scaleY: win_height / img.height, |
|
|
}); |
|
|
|
|
|
if (current_dzone === "dzone_1" && count_zone >= 1) { |
|
|
document.getElementById("CanvasTripwire1").style.visibility = "visible"; |
|
|
document.getElementById("CanvasTripwire2").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire3").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire4").style.visibility = "hidden"; |
|
|
|
|
|
document.getElementsByClassName("div-a")[0].style.visibility = "visible"; |
|
|
document.getElementsByClassName("div-b")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-c")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-d")[0].style.visibility = "hidden"; |
|
|
|
|
|
canvasTripwire1.setBackgroundImage(img, canvasTripwire1.renderAll.bind(canvasTripwire1)); |
|
|
} |
|
|
else if (current_dzone === "dzone_2" && count_zone >= 2) { |
|
|
document.getElementById("CanvasTripwire1").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire2").style.visibility = "visible"; |
|
|
document.getElementById("CanvasTripwire3").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire4").style.visibility = "hidden"; |
|
|
|
|
|
document.getElementsByClassName("div-a")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-b")[0].style.visibility = "visible"; |
|
|
document.getElementsByClassName("div-c")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-d")[0].style.visibility = "hidden"; |
|
|
|
|
|
canvasTripwire2.setBackgroundImage(img, canvasTripwire2.renderAll.bind(canvasTripwire2)); |
|
|
} |
|
|
else if (current_dzone === "dzone_3" && count_zone >= 3) { |
|
|
document.getElementById("CanvasTripwire1").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire2").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire3").style.visibility = "visible"; |
|
|
document.getElementById("CanvasTripwire4").style.visibility = "hidden"; |
|
|
|
|
|
document.getElementsByClassName("div-a")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-b")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-c")[0].style.visibility = "visible"; |
|
|
document.getElementsByClassName("div-d")[0].style.visibility = "hidden"; |
|
|
|
|
|
canvasTripwire3.setBackgroundImage(img, canvasTripwire3.renderAll.bind(canvasTripwire3)); |
|
|
} |
|
|
else if (current_dzone === "dzone_4" && count_zone >= 4) { |
|
|
document.getElementById("CanvasTripwire1").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire2").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire3").style.visibility = "hidden"; |
|
|
document.getElementById("CanvasTripwire4").style.visibility = "visible"; |
|
|
|
|
|
document.getElementsByClassName("div-a")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-b")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-c")[0].style.visibility = "hidden"; |
|
|
document.getElementsByClassName("div-d")[0].style.visibility = "visible"; |
|
|
|
|
|
canvasTripwire4.setBackgroundImage(img, canvasTripwire4.renderAll.bind(canvasTripwire4)); |
|
|
} |
|
|
|
|
|
g_h = h; |
|
|
g_m = m; |
|
|
g_s = s; |
|
|
g_ms = ms; |
|
|
} |
|
|
|
|
|
if ((g_h * 3600 + g_m * 60 + g_s + g_ms / 1000) - (h * 3600 + m * 60 + s + ms / 1000) >= 3600) { |
|
|
g_h = h; |
|
|
g_m = m; |
|
|
g_s = s; |
|
|
g_ms = ms; |
|
|
} |
|
|
|
|
|
img = null; |
|
|
} |
|
|
}); |
|
|
} |
|
|
catch (e) { |
|
|
//console.log(e); |
|
|
} |
|
|
imgUrl = null; |
|
|
}, 100); |
|
|
} |
|
|
*/ |
|
|
$(document).ready(function () { |
|
|
|
|
|
}); |
|
|
|
|
|
</script> |
|
|
</head> |
|
|
|
|
|
<body onContextMenu="window.event.returnValue=false"> |
|
|
|
|
|
<div class="progress" style="background-color:white"> |
|
|
<div class="progress-bar progress-bar-striped" style="min-width: 20px;visibility:hidden;"></div> |
|
|
</div> |
|
|
<div align="center" class="test" div style="border:1px gray solid;padding:20px;margin:15px 15px 15px 15px"> |
|
|
<div class="titlebox"><nobr id="TITLEBOX_PAGE13"></nobr></div> |
|
|
|
|
|
<!-- <table valign="center" style="border-collapse: collapse; width: 300px; height: 160px;" border="0"> --> |
|
|
<table align="center" valign="center" style="border-collapse: collapse; width: 500px; height: auto; "> |
|
|
<tbody> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_SHOW_UNKNOWN_OBJECT"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
<input id="enable_show_unknown_object" type="checkbox" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_IVS_AND_AI"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
<input id="enable_ivs_and_ai" type="checkbox" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_MIN_MAX_PROPORTION_UNKNOWN_OBJECT"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<div class="easyui-slider" id="unknown_object_proportion" style="width:95%;"></div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_CONFIDENCE_UNKNOWN_OBJECT"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<div class="easyui-slider" id="confidence_unknown_object" style="width:95%;"></div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_CONFIDENCE2_UNKNOWN_OBJECT"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<div class="easyui-slider" id="confidence2_unknown_object" style="width:95%;"></div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_UNKNOWN_OBJECT_TIME"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<div class="easyui-slider" id="dwell_unknown_object" style="width:95%;"></div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_IVS_FIX_MODE"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
<input id="enable_ivs_fix_mode" type="checkbox" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_IVS_MODE"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<select name="ivs_mode" id="ivs_mode" onchange=""> |
|
|
<option value="0">IVS Fusion Mode</option> |
|
|
<option value="1">Thermal Mode</option> |
|
|
<option value="2">Ex</option> |
|
|
<option value="3">MOG2</option> |
|
|
</select> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_DWELL_MINUTE_FOCUS_ON"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<div class="easyui-slider" id="dwell_minute_focus_on" style="width:95%;"></div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_CHECK_ENABLE_IVS_PERSON_DETECTION"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
<input id="enable_ivs_person_detection" type="checkbox" /> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_PERSON_FILTER"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<div class="easyui-slider" id="person_obj_fov" style="width:95%;"></div> |
|
|
</td> |
|
|
</tr> |
|
|
<tr style="height: 20px;display:none;"> |
|
|
<td style="width: 200px; height: 20px;" id="IDC_STATIC_ASSIGN_IVS_OBJECT_TO"> </td> |
|
|
<td style="width: 300px; height: 20px;"> |
|
|
|
|
|
<select name="assign_ivs_object_to" id="assign_ivs_object_to" onchange=""> |
|
|
<option value="NULL">None</option> |
|
|
<option value="person">person</option> |
|
|
<option value="bicycle">bicycle</option> |
|
|
<option value="car">car</option> |
|
|
<option value="motorbike">motorbike</option> |
|
|
<option value="bus">bus</option> |
|
|
<option value="truck">truck</option> |
|
|
</select> |
|
|
</td> |
|
|
</tr> |
|
|
</tbody> |
|
|
</table> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<div align="center"> |
|
|
<input align="center" id="IDOK" type="button" value=" Set " onclick="func_setspeed()" style="background-color:#6c87d4;color:white;height:36px;width:300px;" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div> |
|
|
<div align="center" style="margin:5px 0px 0px 0px"> |
|
|
<input align="center" id="IDOK_MISSING" type="button" value="Default for missing object" onclick="func_setmissing()" style="background-color:#6c87d4;color:white;height:36px;width:300px;" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<!-- |
|
|
<div class="div-relative" style="visibility:hidden"> |
|
|
<div class="div-a"> |
|
|
<canvas id="CanvasTripwire1" style="visibility:hidden"></canvas> |
|
|
</div> |
|
|
<div class="div-b"> |
|
|
<canvas id="CanvasTripwire2" style="visibility:hidden"></canvas> |
|
|
</div> |
|
|
<div class="div-c"> |
|
|
<canvas id="CanvasTripwire3" style="visibility:hidden"></canvas> |
|
|
</div> |
|
|
<div class="div-d"> |
|
|
<canvas id="CanvasTripwire4" style="visibility:hidden"></canvas> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div style="visibility:hidden"> |
|
|
<nobr id="IDC_STATIC_DETECTION_ZONE" style="visibility:hidden"> </nobr> |
|
|
<input id="dzone_1" type="button" onclick="func_set_zone_cookie1();" value="1" style="visibility:hidden"/> |
|
|
<input id="dzone_2" type="button" onclick="func_set_zone_cookie2();" value="2" style="visibility:hidden"/> |
|
|
<input id="dzone_3" type="button" onclick="func_set_zone_cookie3();" value="3" style="visibility:hidden"/> |
|
|
<input id="dzone_4" type="button" onclick="func_set_zone_cookie4();" value="4" style="visibility:hidden"/> |
|
|
</div>--> |
|
|
<!-- <div> |
|
|
<textarea style="width: 1700px; height: 500px;" id="test_txtbox"></textarea> |
|
|
</div> --> |
|
|
|
|
|
<script> |
|
|
/* |
|
|
loadScript("config.js", function () { |
|
|
loadScript("cookie.min.js", function () { |
|
|
loadScript("lang.js", function () { |
|
|
loadScript("lang_cookie.js", function () { |
|
|
//alert("all load"); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
});*/ |
|
|
|
|
|
function loadScript(url, callback) { |
|
|
var script = document.createElement("Script"); |
|
|
script.type = "text/javascript"; |
|
|
|
|
|
//IE 验证脚本是否下载完成 |
|
|
if (script.readyState) { |
|
|
script.onreadystatechange = function () { |
|
|
//readyState属性有5种取值 |
|
|
//uninitialized:初始状态 |
|
|
//loading:开始下载 |
|
|
//interactive:数据完成下载但尚不可用 |
|
|
//complete:数据已经准备就绪 |
|
|
//实际使用时,readyState的值并不像我们预想的那样有规律,实践发现使用readyState |
|
|
//最靠谱的方式是同时检查以下2个状态,只要其中1个触发,就认为脚本下载完成。 |
|
|
if (script.readyState == "loaded" || script.readyState == "complete") { |
|
|
//移除事件处理器,确保事件不会处理2次 |
|
|
script.onreadystatechange = null; |
|
|
callback(); |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
//其他浏览器 |
|
|
else { |
|
|
script.onload = function () { |
|
|
callback(); |
|
|
}; |
|
|
} |
|
|
|
|
|
script.src = url; |
|
|
//把新建的<Script>添加到<head>里比添加到<body>里更保险。 |
|
|
document.getElementsByTagName("head")[0].appendChild(script); |
|
|
} |
|
|
|
|
|
//UI Interface |
|
|
func_get_lang_cookie(); |
|
|
|
|
|
document.getElementById("IDC_CHECK_ENABLE_SHOW_UNKNOWN_OBJECT").innerHTML = IDC_CHECK_ENABLE_SHOW_UNKNOWN_OBJECT; |
|
|
document.getElementById("IDC_CHECK_ENABLE_IVS_AND_AI").innerHTML = IDC_CHECK_ENABLE_IVS_AND_AI; |
|
|
document.getElementById("IDC_CHECK_ENABLE_IVS_PERSON_DETECTION").innerHTML = IDC_CHECK_ENABLE_IVS_PERSON_DETECTION; |
|
|
document.getElementById("IDC_STATIC_CONFIDENCE_UNKNOWN_OBJECT").innerHTML = IDC_STATIC_CONFIDENCE_UNKNOWN_OBJECT; |
|
|
document.getElementById("IDC_STATIC_CONFIDENCE2_UNKNOWN_OBJECT").innerHTML = IDC_STATIC_CONFIDENCE2_UNKNOWN_OBJECT; |
|
|
document.getElementById("IDC_STATIC_UNKNOWN_OBJECT_TIME").innerHTML = IDC_STATIC_UNKNOWN_OBJECT_TIME; |
|
|
document.getElementById("IDC_STATIC_DWELL_MINUTE_FOCUS_ON").innerHTML = IDC_STATIC_DWELL_MINUTE_FOCUS_ON; |
|
|
document.getElementById("IDC_STATIC_PERSON_FILTER").innerHTML = IDC_STATIC_PERSON_FILTER; |
|
|
document.getElementById("IDC_STATIC_MIN_MAX_PROPORTION_UNKNOWN_OBJECT").innerHTML = IDC_STATIC_MIN_MAX_PROPORTION_UNKNOWN_OBJECT; |
|
|
|
|
|
document.getElementById("IDC_STATIC_ASSIGN_IVS_OBJECT_TO").innerHTML = IDC_STATIC_ASSIGN_IVS_OBJECT_TO; |
|
|
document.getElementById("IDC_STATIC_IVS_MODE").innerHTML = IDC_STATIC_IVS_MODE; |
|
|
document.getElementById("IDC_CHECK_ENABLE_IVS_FIX_MODE").innerHTML = IDC_CHECK_ENABLE_IVS_FIX_MODE; |
|
|
|
|
|
$('#IDOK').val(IDOK); |
|
|
$('#IDOK_MISSING').val(IDOK_MISSING); |
|
|
document.getElementById("TITLEBOX_PAGE13").innerHTML = TITLEBOX_PAGE13; |
|
|
|
|
|
//document.getElementById("IDC_STATIC_DETECTION_ZONE").innerHTML = IDC_STATIC_DETECTION_ZONE; |
|
|
|
|
|
var enable_show_unknown_object = "No"; |
|
|
var enable_ivs_and_ai = "No"; |
|
|
var enable_ivs_person_detection = "No"; |
|
|
var enable_ivs_fix_mode = "No"; |
|
|
var unknown_object_max_proportion = "20"; |
|
|
var unknown_object_min_proportion = "0"; |
|
|
var confidence_unknown_object = "0"; |
|
|
var confidence2_unknown_object = "0"; |
|
|
var dwell_unknown_object = "30"; |
|
|
var dwell_minute_focus_on = "5"; |
|
|
var person_obj_fov = "100"; |
|
|
|
|
|
var current_dzone = "dzone_1"; |
|
|
var MAX_DETECTION_ZONE = 8; |
|
|
|
|
|
var count_zone = 0; |
|
|
//var points_x_config = new Array(MAX_DETECTION_ZONE); |
|
|
//var points_y_config = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var tab_view_size = new Array(2); |
|
|
|
|
|
var enable_speed = new Array(MAX_DETECTION_ZONE); |
|
|
var set_distance = new Array(MAX_DETECTION_ZONE); |
|
|
var world_distance_unit = new Array(MAX_DETECTION_ZONE); |
|
|
var world_distance_side1 = new Array(MAX_DETECTION_ZONE); |
|
|
var world_distance_side2 = new Array(MAX_DETECTION_ZONE); |
|
|
var world_time_unit = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var no_parking_time = new Array(MAX_DETECTION_ZONE); |
|
|
|
|
|
var assign_ivs_object_to = "NULL"; |
|
|
var ivs_mode = "3"; |
|
|
|
|
|
{ |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
//points_x_config[i] = new Array(MAX_SIZE_POINTS); |
|
|
//points_y_config[i] = new Array(MAX_SIZE_POINTS); |
|
|
enable_speed[i] = "No"; |
|
|
set_distance[i] = "10"; |
|
|
world_distance_unit[i] = "meter"; |
|
|
world_distance_side1[i] = "10"; |
|
|
world_distance_side2[i] = "10"; |
|
|
world_time_unit[i] = "KPH"; |
|
|
} |
|
|
} |
|
|
|
|
|
var image_width = GetMaxWidth(); |
|
|
var image_height = GetMaxHeight(); |
|
|
|
|
|
//func_getSpeedData(); |
|
|
//enable_detection_zone_button(); |
|
|
//change_color_of_button_zone(); |
|
|
|
|
|
/* |
|
|
createCanvasTrafficLight_object([{ |
|
|
x: Math.round(points_x_config[0][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][3] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[0][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[0][5] * image_height / tab_view_size[1]) |
|
|
}], |
|
|
[{ |
|
|
x: Math.round(points_x_config[1][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][3] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[1][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[1][5] * image_height / tab_view_size[1]) |
|
|
}], |
|
|
[{ |
|
|
x: Math.round(points_x_config[2][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][3] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[2][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[2][5] * image_height / tab_view_size[1]) |
|
|
}], |
|
|
[{ |
|
|
x: Math.round(points_x_config[3][0] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][0] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][1] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][1] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][2] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][2] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][3] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][3] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][4] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][4] * image_height / tab_view_size[1]) |
|
|
}, { |
|
|
x: Math.round(points_x_config[3][5] * image_width / tab_view_size[0]), y: Math.round(points_y_config[3][5] * image_height / tab_view_size[1]) |
|
|
}]); |
|
|
createCanvasTrafficLight();*/ |
|
|
//update_canvas(); |
|
|
|
|
|
//disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
//disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
//disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
//disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
|
|
|
$("#unknown_object_proportion").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: 12, |
|
|
value: [0, 100], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
range: true, |
|
|
min: 0, |
|
|
max: 100, |
|
|
// step:2.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#confidence_unknown_object").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 0, |
|
|
max: 100, |
|
|
// step:2.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#confidence2_unknown_object").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 0, |
|
|
max: 100, |
|
|
// step:2.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#dwell_unknown_object").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 10, |
|
|
max: 500, |
|
|
// step:2.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#dwell_minute_focus_on").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 1, |
|
|
max: 60, |
|
|
step: 1, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
$("#person_obj_fov").slider({ |
|
|
//width: 300, |
|
|
//height: 300, |
|
|
//value: [1, 30], |
|
|
mode: 'h',//v,h |
|
|
showTip: true, |
|
|
//range: true, |
|
|
//将最大最小值对调 |
|
|
// reversed:true, |
|
|
// disabled:true, |
|
|
min: 0, |
|
|
max: 100, |
|
|
// step:2.5, |
|
|
//提示格式函数 |
|
|
tipFormatter: function (value) { |
|
|
// return '['+value+']'; |
|
|
return value; |
|
|
}, |
|
|
onChange: function (newValue, oldValue) { |
|
|
// alert(newValue+" | "+oldValue); |
|
|
}, |
|
|
onSlideStart: function (value) { |
|
|
// alert(value); |
|
|
}, |
|
|
onSlideEnd: function (value) { |
|
|
// alert(value); |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
func_getObjectData(); |
|
|
func_showObjectData(); |
|
|
|
|
|
/* |
|
|
function func_set_zone_cookie1() { |
|
|
if (current_dzone != "dzone_1") { |
|
|
func_setObjectData(); |
|
|
} |
|
|
|
|
|
current_dzone = "dzone_1"; |
|
|
change_color_of_button_zone(); |
|
|
func_showObjectData(); |
|
|
|
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie2() { |
|
|
if (current_dzone != "dzone_2") { |
|
|
func_setObjectData(); |
|
|
} |
|
|
|
|
|
current_dzone = "dzone_2"; |
|
|
change_color_of_button_zone(); |
|
|
func_showObjectData(); |
|
|
|
|
|
|
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie3() { |
|
|
if (current_dzone != "dzone_3") { |
|
|
func_setObjectData(); |
|
|
} |
|
|
|
|
|
current_dzone = "dzone_3"; |
|
|
change_color_of_button_zone(); |
|
|
func_showObjectData(); |
|
|
|
|
|
|
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
} |
|
|
|
|
|
function func_set_zone_cookie4() { |
|
|
if (current_dzone != "dzone_4") { |
|
|
func_setObjectData(); |
|
|
} |
|
|
|
|
|
current_dzone = "dzone_4"; |
|
|
change_color_of_button_zone(); |
|
|
func_showObjectData(); |
|
|
|
|
|
|
|
|
if (get_check_edit2() === 1) { |
|
|
disabelIteraction(canvasTripwire2.getObjects()[0]); |
|
|
Edit2(); |
|
|
} |
|
|
if (get_check_edit3() === 1) { |
|
|
disabelIteraction(canvasTripwire3.getObjects()[0]); |
|
|
Edit3(); |
|
|
} |
|
|
if (get_check_edit4() === 1) { |
|
|
disabelIteraction(canvasTripwire4.getObjects()[0]); |
|
|
Edit4(); |
|
|
} |
|
|
|
|
|
if (get_check_edit1() === 1) { |
|
|
disabelIteraction(canvasTripwire1.getObjects()[0]); |
|
|
Edit1(); |
|
|
} |
|
|
} |
|
|
|
|
|
function change_color_of_button_zone() { |
|
|
if (current_dzone === "dzone_1") { |
|
|
document.getElementById("dzone_1").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "white"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "white"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#6c87d4"; |
|
|
document.getElementById("dzone_4").style.background = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#6c87d4"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#BABABA"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "white"; |
|
|
document.getElementById("dzone_4").style.color = "black"; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
document.getElementById("dzone_1").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.background = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.background = "#6c87d4"; |
|
|
|
|
|
document.getElementById("dzone_1").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_2").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_3").style.borderColor = "#BABABA"; |
|
|
document.getElementById("dzone_4").style.borderColor = "#6c87d4"; |
|
|
|
|
|
document.getElementById("dzone_1").style.color = "black"; |
|
|
document.getElementById("dzone_2").style.color = "black"; |
|
|
document.getElementById("dzone_3").style.color = "black"; |
|
|
document.getElementById("dzone_4").style.color = "white"; |
|
|
} |
|
|
} |
|
|
*/ |
|
|
|
|
|
/* |
|
|
function func_getSpeedData() { |
|
|
$.ajax({ |
|
|
url: "/getconfig?ch=01", |
|
|
type: "GET", |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function (retdata) { |
|
|
var jsonbuf = validatingJSON(retdata); |
|
|
|
|
|
if (jsonbuf != null) { |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
enable_speed[i] = jsonbuf["detection_zone"][i]["enable_speed"]; |
|
|
set_distance[i] = jsonbuf["detection_zone"][i]["set_distance"]; |
|
|
world_distance_unit[i] = jsonbuf["detection_zone"][i]["world_distance_unit"]; |
|
|
world_distance_side1[i] = jsonbuf["detection_zone"][i]["world_distance_side1"]; |
|
|
world_distance_side2[i] = jsonbuf["detection_zone"][i]["world_distance_side2"]; |
|
|
world_time_unit[i] = jsonbuf["detection_zone"][i]["world_time_unit"]; |
|
|
} |
|
|
|
|
|
func_showObjectData(); |
|
|
} |
|
|
|
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
}*/ |
|
|
|
|
|
function func_showObjectData() { |
|
|
/* |
|
|
var index_dzone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_dzone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_dzone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_dzone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_dzone = 3; |
|
|
}*/ |
|
|
|
|
|
/* |
|
|
if (enable_speed[index_dzone] === 'Yes') |
|
|
$('#enable_speed').prop("checked", true); |
|
|
else |
|
|
$('#enable_speed').prop("checked", false); |
|
|
$('#overspeed').slider('setValue', set_distance[index_dzone]); |
|
|
$('#border_1').slider('setValue', world_distance_side1[index_dzone]); |
|
|
$('#border_2').slider('setValue', world_distance_side2[index_dzone]);*/ |
|
|
//$("#border_unit").val(world_distance_unit[index_dzone]); |
|
|
//$("#time_unit").val(world_time_unit[index_dzone]); |
|
|
|
|
|
if (enable_show_unknown_object === 'Yes') |
|
|
$('#enable_show_unknown_object').prop("checked", true); |
|
|
else |
|
|
$('#enable_show_unknown_object').prop("checked", false); |
|
|
|
|
|
if (enable_ivs_fix_mode === 'Yes') |
|
|
$('#enable_ivs_fix_mode').prop("checked", true); |
|
|
else |
|
|
$('#enable_ivs_fix_mode').prop("checked", false); |
|
|
|
|
|
if (enable_ivs_and_ai === 'Yes') |
|
|
$('#enable_ivs_and_ai').prop("checked", true); |
|
|
else |
|
|
$('#enable_ivs_and_ai').prop("checked", false); |
|
|
|
|
|
if (enable_ivs_person_detection === 'Yes') |
|
|
$('#enable_ivs_person_detection').prop("checked", true); |
|
|
else |
|
|
$('#enable_ivs_person_detection').prop("checked", false); |
|
|
|
|
|
$('#unknown_object_proportion').slider('setValues', [unknown_object_min_proportion, unknown_object_max_proportion]); |
|
|
$('#confidence_unknown_object').slider('setValue', confidence_unknown_object); |
|
|
$('#confidence2_unknown_object').slider('setValue', confidence2_unknown_object); |
|
|
$('#dwell_unknown_object').slider('setValue', dwell_unknown_object); |
|
|
$('#dwell_minute_focus_on').slider('setValue', dwell_minute_focus_on); |
|
|
$('#person_obj_fov').slider('setValue', person_obj_fov); |
|
|
$("#assign_ivs_object_to").val(assign_ivs_object_to); |
|
|
$("#ivs_mode").val(ivs_mode); |
|
|
} |
|
|
|
|
|
function func_setObjectData() { |
|
|
/* |
|
|
var index_dzone = 0; |
|
|
if (current_dzone === "dzone_1") { |
|
|
index_dzone = 0; |
|
|
} |
|
|
else if (current_dzone === "dzone_2") { |
|
|
index_dzone = 1; |
|
|
} |
|
|
else if (current_dzone === "dzone_3") { |
|
|
index_dzone = 2; |
|
|
} |
|
|
else if (current_dzone === "dzone_4") { |
|
|
index_dzone = 3; |
|
|
} |
|
|
|
|
|
if ($('#enable_speed').is(":checked")) { |
|
|
enable_speed[index_dzone] = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_speed[index_dzone] = "No"; |
|
|
} |
|
|
set_distance[index_dzone] = $('#overspeed').slider('getValue'); |
|
|
world_distance_side1[index_dzone] = $('#border_1').slider('getValue'); |
|
|
world_distance_side2[index_dzone] = $('#border_2').slider('getValue');*/ |
|
|
//world_distance_unit[index_dzone] = $("#border_unit").val(); |
|
|
//world_time_unit[index_dzone] = $("#time_unit").val(); |
|
|
|
|
|
if ($('#enable_show_unknown_object').is(":checked")) { |
|
|
enable_show_unknown_object = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_show_unknown_object = "No"; |
|
|
} |
|
|
|
|
|
if ($('#enable_ivs_fix_mode').is(":checked")) { |
|
|
enable_ivs_fix_mode = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_ivs_fix_mode = "No"; |
|
|
} |
|
|
|
|
|
if ($('#enable_ivs_and_ai').is(":checked")) { |
|
|
enable_ivs_and_ai = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_ivs_and_ai = "No"; |
|
|
} |
|
|
|
|
|
if ($('#enable_ivs_person_detection').is(":checked")) { |
|
|
enable_ivs_person_detection = "Yes"; |
|
|
} |
|
|
else { |
|
|
enable_ivs_person_detection = "No"; |
|
|
} |
|
|
|
|
|
unknown_object_max_proportion = $('#unknown_object_proportion').slider('getValues')[1]; |
|
|
unknown_object_min_proportion = $('#unknown_object_proportion').slider('getValues')[0]; |
|
|
|
|
|
confidence_unknown_object = $('#confidence_unknown_object').slider('getValue'); |
|
|
confidence2_unknown_object = $('#confidence2_unknown_object').slider('getValue'); |
|
|
dwell_unknown_object = $('#dwell_unknown_object').slider('getValue'); |
|
|
dwell_minute_focus_on = $('#dwell_minute_focus_on').slider('getValue'); |
|
|
person_obj_fov = $('#person_obj_fov').slider('getValue'); |
|
|
|
|
|
assign_ivs_object_to = $("#assign_ivs_object_to").val(); |
|
|
ivs_mode = $("#ivs_mode").val(); |
|
|
} |
|
|
|
|
|
function validatingJSON(json) { |
|
|
|
|
|
var checkedjson; |
|
|
try { |
|
|
checkedjson = JSON.parse(json); //JSON parse only for try catch |
|
|
//console.log("json OK"); |
|
|
//console.log(json); |
|
|
} catch (e) { |
|
|
checkedjson = null; |
|
|
console.log(e);//the character would be drop sometimes, for example the label "class_id" may be "clas_id". |
|
|
//console.log(json); |
|
|
} |
|
|
return checkedjson; |
|
|
} |
|
|
|
|
|
function func_getObjectData() { |
|
|
|
|
|
$.ajax({ |
|
|
url: "/getconfig?ch=01", |
|
|
type: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function (retdata) { |
|
|
//var jsonbuf = JSON.parse('{ "name":"John", "age":30, "city":"New York"}'); |
|
|
var jsonbuf = validatingJSON(retdata); |
|
|
|
|
|
enable_show_unknown_object = jsonbuf["enable_show_unknown_object"]; |
|
|
enable_ivs_fix_mode = jsonbuf["enable_ivs_fix_mode"]; |
|
|
enable_ivs_and_ai = jsonbuf["enable_ivs_and_ai"]; |
|
|
enable_ivs_person_detection = jsonbuf["enable_ivs_person_detection"]; |
|
|
unknown_object_max_proportion = jsonbuf["unknown_object_max_proportion"]; |
|
|
unknown_object_min_proportion = jsonbuf["unknown_object_min_proportion"]; |
|
|
confidence_unknown_object = jsonbuf["confidence_unknown_object"]; |
|
|
confidence2_unknown_object = jsonbuf["confidence2_unknown_object"]; |
|
|
dwell_unknown_object = jsonbuf["dwell_unknown_object"]; |
|
|
dwell_minute_focus_on = jsonbuf["dwell_minute_focus_on"]; |
|
|
person_obj_fov = jsonbuf["person_obj_fov"]; |
|
|
assign_ivs_object_to = jsonbuf["assign_ivs_object_to"]; |
|
|
ivs_mode = jsonbuf["ivs_mode"]; |
|
|
|
|
|
if (assign_ivs_object_to.length == 0) { |
|
|
assign_ivs_object_to = "NULL"; |
|
|
} |
|
|
|
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
no_parking_time[i] = jsonbuf["detection_zone"][i]["no_parking_time"]; |
|
|
} |
|
|
|
|
|
/* |
|
|
tab_view_size = jsonbuf["tab_view_size"].split("x"); |
|
|
tab_view_size[0] = parseInt(tab_view_size[0], 10); |
|
|
tab_view_size[1] = parseInt(tab_view_size[1], 10); |
|
|
count_zone = jsonbuf["count_zone"];*/ |
|
|
|
|
|
/* |
|
|
if (jsonbuf != null) { |
|
|
for (var i = 0; i < MAX_DETECTION_ZONE; i++) { |
|
|
|
|
|
for (var j = 0; j < MAX_SIZE_POINTS; j++) { |
|
|
points_x_config[i][j] = jsonbuf["detection_zone"][i]["x" + (j + 1).toString()]; |
|
|
points_y_config[i][j] = jsonbuf["detection_zone"][i]["y" + (j + 1).toString()]; |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}*/ |
|
|
|
|
|
//console.info(retdata); |
|
|
}, |
|
|
error: function (retdata) { |
|
|
console.warn(retdata); |
|
|
} |
|
|
}); |
|
|
} |
|
|
/* |
|
|
function enable_detection_zone_button() { |
|
|
if (count_zone === 0) { |
|
|
document.getElementById("dzone_1").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_2").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_3").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 1) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_3").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 2) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "hidden"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 3) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "hidden"; |
|
|
} |
|
|
else if (count_zone === 4) { |
|
|
document.getElementById("dzone_1").style.visibility = "visible"; |
|
|
document.getElementById("dzone_2").style.visibility = "visible"; |
|
|
document.getElementById("dzone_3").style.visibility = "visible"; |
|
|
document.getElementById("dzone_4").style.visibility = "visible"; |
|
|
} |
|
|
}*/ |
|
|
|
|
|
function func_setspeed() { |
|
|
k_index = 0; |
|
|
makeProgress(); |
|
|
} |
|
|
|
|
|
function func_setmissing() { |
|
|
k_index = 0; |
|
|
makeProgress_missing(); |
|
|
} |
|
|
|
|
|
function sleep(milliseconds) { |
|
|
var start = new Date().getTime(); |
|
|
for (var i = 0; i < 1e7; i++) { |
|
|
if ((new Date().getTime() - start) > milliseconds) { |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function func_setconfigfile(json_data) { |
|
|
$.ajax({ |
|
|
url: "/setconfigfile", |
|
|
method: "POST", |
|
|
async: false, |
|
|
data: json_data, |
|
|
contentType: false, |
|
|
processData: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
|
|
|
k_index++; |
|
|
|
|
|
if (k_index <= 94) { |
|
|
waitSeconds(500); |
|
|
func_setconfigfile(json_data); |
|
|
} |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_run_osd_server() { |
|
|
$.ajax({ |
|
|
url: "/run_osd_server", |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_setelement_detection_zone(name_, value_, zone_) { |
|
|
$.ajax({ |
|
|
url: "/setconfig?ch=1&detection_zone=" + zone_ + "&" + name_ + "=" + value_, |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function func_setelement(name_, value_) { |
|
|
$.ajax({ |
|
|
url: "/setconfig?ch=1&" + name_ + "=" + value_, |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
success: function () { |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
var count_reload = 0; |
|
|
function func_getreload() { |
|
|
$.ajax({ |
|
|
url: "/getconfig?reload=1", |
|
|
method: "GET", |
|
|
async: false, |
|
|
beforeSend: function (xmlHttp) { |
|
|
xmlHttp.setRequestHeader("If-Modified-Since", "0"); |
|
|
xmlHttp.setRequestHeader("Cache-Control", "no-cache"); |
|
|
//xmlHttp.setRequestHeader("Authorization", "Basic " + btoa("username:password")); |
|
|
}, |
|
|
//data : JSON.stringify(data), |
|
|
success: function (retdata) { |
|
|
count_reload++; |
|
|
if (retdata === "Reload OK.") { |
|
|
count_reload = 0; |
|
|
//console.log("Reload OK."); |
|
|
} |
|
|
else { |
|
|
if (count_reload <= 3) { |
|
|
setTimeout(func_getreload(), 2000); |
|
|
} |
|
|
else { |
|
|
count_reload = 0; |
|
|
} |
|
|
} |
|
|
//console.info(); |
|
|
}, |
|
|
error: function () { |
|
|
console.warn(); |
|
|
} |
|
|
}); |
|
|
return false; |
|
|
} |
|
|
|
|
|
function waitSeconds(iMilliSeconds) { |
|
|
|
|
|
var counter = 0 |
|
|
|
|
|
, start = new Date().getTime() |
|
|
|
|
|
, end = 0; |
|
|
|
|
|
while (counter < iMilliSeconds) { |
|
|
|
|
|
end = new Date().getTime(); |
|
|
|
|
|
counter = end - start; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
var k_index = -1; |
|
|
$(".progress-bar").css("visibility", "hidden"); |
|
|
function makeProgress() { |
|
|
if (k_index < 100 && k_index >= 0) { |
|
|
k_index = k_index + 1; |
|
|
$(".progress-bar").css("visibility", "visible"); |
|
|
//$(".progress-bar").css("width", k_index + "%").text(k_index + " %"); |
|
|
$(".progress-bar").css("width", k_index + "%"); |
|
|
|
|
|
if (k_index == 1) { |
|
|
$('html, body').scrollTop(0); |
|
|
func_setObjectData(); |
|
|
|
|
|
var json_data = '{'; |
|
|
json_data += '"view_setting":{'; |
|
|
json_data += '"camera01":{'; |
|
|
json_data += '"enable_show_unknown_object": "' + enable_show_unknown_object + '",'; |
|
|
json_data += '"enable_ivs_fix_mode": "' + enable_ivs_fix_mode + '",'; |
|
|
json_data += '"enable_ivs_and_ai": "' + enable_ivs_and_ai + '",'; |
|
|
json_data += '"unknown_object_max_proportion": "' + unknown_object_max_proportion + '",'; |
|
|
json_data += '"unknown_object_min_proportion": "' + unknown_object_min_proportion + '",'; |
|
|
json_data += '"confidence_unknown_object": "' + confidence_unknown_object + '",'; |
|
|
json_data += '"confidence2_unknown_object": "' + confidence2_unknown_object + '",'; |
|
|
json_data += '"dwell_unknown_object": "' + dwell_unknown_object + '",'; |
|
|
json_data += '"dwell_minute_focus_on": "' + dwell_minute_focus_on + '",'; |
|
|
json_data += '"enable_ivs_person_detection": "' + enable_ivs_person_detection + '",'; |
|
|
json_data += '"assign_ivs_object_to": "' + assign_ivs_object_to + '",'; |
|
|
json_data += '"ivs_mode": "' + ivs_mode + '",'; |
|
|
json_data += '"person_obj_fov": "' + person_obj_fov + '"'; |
|
|
json_data += '}'; |
|
|
json_data += '}'; |
|
|
json_data += '}'; |
|
|
|
|
|
func_setconfigfile(json_data); |
|
|
k_index = 94; |
|
|
} |
|
|
else if (k_index == 95) { |
|
|
//waitSeconds(500); |
|
|
} |
|
|
else if (k_index == 100) { |
|
|
func_run_osd_server(); |
|
|
$(".progress-bar").css("visibility", "hidden"); |
|
|
//$(".progress-bar").css("width", "0%").text("0 %"); |
|
|
$(".progress-bar").css("width", "0%"); |
|
|
k_index = -1; |
|
|
} |
|
|
// Wait for sometime before running this script again |
|
|
setTimeout("makeProgress()", 200); |
|
|
} |
|
|
} |
|
|
|
|
|
function makeProgress_missing() { |
|
|
if (k_index < 100 && k_index >= 0) { |
|
|
k_index = k_index + 1; |
|
|
$(".progress-bar").css("visibility", "visible"); |
|
|
//$(".progress-bar").css("width", k_index + "%").text(k_index + " %"); |
|
|
$(".progress-bar").css("width", k_index + "%"); |
|
|
|
|
|
if (k_index == 1) { |
|
|
$('html, body').scrollTop(0); |
|
|
func_setObjectData(); |
|
|
|
|
|
enable_show_unknown_object = "No"; |
|
|
enable_ivs_and_ai = "No"; |
|
|
enable_ivs_fix_mode = "No"; |
|
|
unknown_object_max_proportion = "40"; |
|
|
unknown_object_min_proportion = "3"; |
|
|
confidence_unknown_object = "5"; |
|
|
confidence2_unknown_object = "5"; |
|
|
dwell_unknown_object = "100"; |
|
|
dwell_minute_focus_on = "5"; |
|
|
enable_ivs_person_detection = "No"; |
|
|
assign_ivs_object_to = "NULL"; |
|
|
person_obj_fov = "100"; |
|
|
|
|
|
var json_data = '{'; |
|
|
json_data += '"view_setting":{'; |
|
|
json_data += '"camera01":{'; |
|
|
json_data += '"enable_show_unknown_object": "' + enable_show_unknown_object + '",'; |
|
|
json_data += '"enable_ivs_and_ai": "' + enable_ivs_and_ai + '",'; |
|
|
json_data += '"unknown_object_max_proportion": "' + unknown_object_max_proportion + '",'; |
|
|
json_data += '"unknown_object_min_proportion": "' + unknown_object_min_proportion + '",'; |
|
|
json_data += '"confidence_unknown_object": "' + confidence_unknown_object + '",'; |
|
|
json_data += '"confidence2_unknown_object": "' + confidence2_unknown_object + '",'; |
|
|
json_data += '"dwell_unknown_object": "' + dwell_unknown_object + '",'; |
|
|
json_data += '"dwell_minute_focus_on": "' + dwell_minute_focus_on + '",'; |
|
|
json_data += '"enable_ivs_person_detection": "' + enable_ivs_person_detection + '",'; |
|
|
json_data += '"assign_ivs_object_to": "' + assign_ivs_object_to + '",'; |
|
|
json_data += '"person_obj_fov": "' + person_obj_fov + '"'; |
|
|
json_data += '}'; |
|
|
json_data += '}'; |
|
|
json_data += '}'; |
|
|
|
|
|
func_setconfigfile(json_data); |
|
|
func_showObjectData(); |
|
|
k_index = 94; |
|
|
} |
|
|
else if (k_index == 95) { |
|
|
//waitSeconds(500); |
|
|
} |
|
|
else if (k_index == 100) { |
|
|
func_run_osd_server(); |
|
|
$(".progress-bar").css("visibility", "hidden"); |
|
|
//$(".progress-bar").css("width", "0%").text("0 %"); |
|
|
$(".progress-bar").css("width", "0%"); |
|
|
k_index = -1; |
|
|
} |
|
|
// Wait for sometime before running this script again |
|
|
setTimeout("makeProgress_missing()", 200); |
|
|
} |
|
|
} |
|
|
|
|
|
//localStorage.setItem('anpr_index_success', 'OK'); |
|
|
</script> |
|
|
</body> |
|
|
</html> |