I am trying to build opencv.js from the source. To do this, I have followed this tutorial. When I clear the functions that I don’t need in opencv_js.config.py, set the cmake options in build_js.py and build with python ./platforms/js/build_js.py build_wasm --build_wasm --emscripten_dir /YOUR_PATH/emsdk/upstream/emscripten, I get a ~3.8Mb file. When I try to run my web app with these files, I get the following error:
Uncaught TypeError: cv.VideoCapture is not a constructor at HTMLVideoElement.<anonymous>
Has anyone built successfully from source including videoio package?
According to the examples, the cv.VideoCapture() is used like this:
let cap = new cv.VideoCapture(video);
And this is the way that I was using it. I took the opencv.js file from this repo which is 13Mb, and I wanted to recompile it from the source using the functions that I need only.