diff --git a/observe_bact.html b/observe_bact.html index 4bb9936..1cd6bbc 100644 --- a/observe_bact.html +++ b/observe_bact.html @@ -96,7 +96,6 @@ - @@ -137,10 +136,20 @@ return (last_rect.x-rect.x)**2 + (last_rect.y-rect.y)**2; } - + var opencv_runing = false; function do_opencv_magic() { + if (opencv_runing){ + streaming = false; + opencv_runing = false; + + startup(); + } + else { + opencv_runing = true; + streaming = true; + } var cap = new cv.VideoCapture(video); let src = new cv.Mat(video.offsetHeight, video.offsetWidth, cv.CV_8UC4); let dst = new cv.Mat(video.offsetHeight, video.offsetWidth, cv.CV_8UC1); @@ -161,14 +170,6 @@ let fits = []; let rects = []; - //for (let k = 0; k < objects_tracked.length; ++k){ - // if (objects_tracked[k].at(-1)[0] < framecount-1){ - // objects_lost.push(objects_tracked[k]); - // objects_tracked.splice(k, 1); - // } - //} - //console.log(objects_last); - try { if (!streaming) { // clean and stop.