emscripten-core / emscripten-core/emscripten
openCV wasm build framerate half that of openCV.js issue
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
I am making a simple cpp application that takes in a video frame runs the gaussianblurr opencv function on it then returns the frame. I compiled it to wasm successfully. I tested how fast it ran when compared with js code with a few cpu intensive math calculations and the wasm code did them in a fraction of the time it took for js code to do. So my wasm code was working.
It was working fast until I actually uncommented the "GaussianBlur( matrix1, resultImage, Size( 7, 7), 0, 0 );" line from my cpp code and compiled it again. once that opencv function was introduced it was rendering the frames to the canvas at 20fps.
I implemented the same function on another html page using opencv.js(wasm embedded) and it ran at 40fps. exactly twice as fast. For some reason the opencv module in my cpp code compiled to wasm is running at half the speed opencv.js runs at.
[cppProgramWasm.zip](https://github.com/emscripten-core/emscripten/files/6410100/cppProgramWasm.zip)
[opencvjs.zip](https://github.com/emscripten-core/emscripten/files/6410102/opencvjs.zip)
I've uploaded both so that someone can help me understand why my wasm module compiled from cpp file that includes some opencv modules is performing the gaussianblurr function half as fast when compared to opencv.js(wasm embedded).
Contributor guide
Assessment
This issue has not been assessed yet.