Graduate

commit

......@@ -30,7 +30,7 @@
</div>
<script type='text/javascript' src={{url_for('static', filename='js/opencv.js')}}>
<script type='text/javascript'>
let video = document.getElementById('videoElement');
var video = document.querySelector("#videoElement");
if (navigator.mediaDevices.getUserMedia){
navigator.mediaDevices.getUserMedia({ video: true })
.then(function (stream) {
......@@ -41,6 +41,7 @@ if (navigator.mediaDevices.getUserMedia){
}
</script>
<script>
let video = document.getElementById('videoElement');
let src = new cv.Mat(video.height, video.width, cv.CV_8UC4);
let dst = new cv.Mat(video.height, video.width, cv.CV_8UC4);
let gray = new cv.Mat();
......@@ -81,8 +82,9 @@ if (navigator.mediaDevices.getUserMedia){
utils.printError(err);
}
};
// schedule the first one.
setTimeout(processVideo, 0);
// schedule the first one.
setTimeout(processVideo, 0);
</script>
</body>
</html>
......