Graduate

Opencv.js face detect

......@@ -41,6 +41,9 @@ if (navigator.mediaDevices.getUserMedia){
}
</script>
<script>
function openCvReady() {
cv['onRuntimeInitialized']=()=>{
// do all your work here
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);
......@@ -81,10 +84,11 @@ if (navigator.mediaDevices.getUserMedia){
} catch (err) {
utils.printError(err);
}
// schedule the first one.
setTimeout(processVideo, 0);
};
// schedule the first one.
setTimeout(processVideo, 0);
};
}
</script>
</body>
</html>
......