Graduate

Update index.html UI

[1128/194240.844:ERROR:directory_reader_win.cc(43)] FindFirstFile: 지정된 경로를 찾을 수 없습니다. (0x3)
......
......@@ -59,12 +59,19 @@ function init()
.then(function (stream) {
video.srcObject = stream;
video.addEventListener('canplay', () => {
var screenWidth = $(document).width();
var screenHeight = $(document).height();
var headerHeight = $('#header').height();
var messageboxHeight = $('#messagebox').height();
video.width = video.videoWidth;
video.height = video.videoHeight;
container.style.width = video.videoWidth + 'px';
container.style.height = video.videoHeight + 'px';
canvasOutput.width = video.videoWidth;
canvasOutput.height = video.videoHeight;
if (video.width > screenWidth || video.height + headerHeight + messageboxHeight > screenHeight){
var ratio = Math.min(screenWidth / video.width * 1.0, screenHeight / ((video.height + headerHeight + messageboxHeight) * 1.0));
container.style.width = Math.round(video.videoWidth * ratio) + 'px';
container.style.height = Math.round(video.videoHeight * ratio) + 'px';
canvasOutput.width = Math.round(video.videoWidth * ratio);
canvasOutput.height = Math.round(video.videoHeight * ratio);
}
load_cascade();
});
}).catch(function (err0r) {
......@@ -200,6 +207,8 @@ function main()
}
}
// to do resize preview
var dsize = new cv.Size(canvasOutput.width, canvasOutput.height);
cv.resize(dst, dst, dsize, 0, 0, cv.INTER_AREA);
cv.imshow('canvasOutput', dst);
// schedule the next one.
let delay = 1000/FPS - (Date.now() - begin);
......@@ -213,7 +222,7 @@ function main()
</script>
</head>
<body onload="cv['onRuntimeInitialized']=()=>{ init(); };">
<div>
<div id="header">
<!-- Header -->
<header class="w3-container w3-center w3-padding-32">
<h1><b>얼굴 인식 출석 시스템</b></h1>
......