Forked from opencvjs.
- Get the source code
git clone https://github.com/biggzlar/opencv_js_compiler.git
cd opencv_js_compiler
git clone https://github.com/opencv/opencv
- Install emscripten. You can obtain emscripten by using Emscripten SDK.
./emsdk update
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
- Compile OpenCV and your source file.
python n_make.py example/example.cpp
- Add the compiled javascript module to your
.html
file.
<script type='text/javascript'>
var Module = {
preRun: [],
postRun: []
};
</script>
<script async src='example.js'></script>