here is the sample code, it’s almost the same as the tutorial sample code but just instead of the color conversion it’s the median blur, the code works, but it takes 20 seconds to work, while in the tutorial it’s immediate. any ideas why?
also in another program when I tried blur video frames it took minute and a half until the first frame and then it did it fine
Hello OpenCV.js
Hello OpenCV.js
OpenCV.js is loading...
imageSrc
You are not showing any code…
In the title you mention “activation” and in the post “working” - very different things.
And of course different tasks take different amounts of time. Blurring can be slow, depending on the radius and size of the image, and the speed of your computer - which information you are hiding.
the code was rendered to HTML ,
lets look on the code from this tutorial, and i replace the onload function to this onload function,
imgElement.onload = function() {
let mat = cv.imread(imgElement);
let dst = new cv.Mat();
// You can try more different parameters
cv.medianBlur(mat, dst, 5);
cv.imshow(‘canvasOutput’, dst);
dst.delete()
mat.delete();
};
in the tutorial, the image is loaded in a blink of an eye, but in my code, it takes 20 seconds for the image to load and then appear on the canvas.
but in this tutorial, where I use exactly the same function the image processing is also immediate, so it’s not because my computer is slow. so why when I use it it takes so much time?