OpenCV
3.3.1
Open Source Computer Vision
|
Emscripten is an LLVM-to-JavaScript compiler. We will use Emscripten to build OpenCV.js.
To Install Emscripten, follow instructions of Emscripten SDK.
For example:
emsdk
command. Please refer to Developer's Guide for more details.After install, ensure the EMSCRIPTEN
environment is setup correctly.
For example:
You can use the latest stable OpenCV version or you can grab the latest snapshot from our Git repository.
Launch Git client and clone OpenCV repository.
For example:
git
installed in your development environment.To build opencv.js
, execute python script <opencv_src_dir>/platforms/js/build_js.py <build_dir>
.
For example, to build in build_js
directory:
python
and cmake
installed in your development environment.The build script builds asm.js version by default. To build WebAssembly version, append --build_wasm
switch.
For example, to build wasm version in build_wasm
directory:
[optional] To build documents, append --build_doc
option.
For example:
doxygen
installed in your development environment.[optional] To build tests, append --build_test
option.
For example:
To run tests, launch a local web server in <build_dir>/bin folder. For example, node http-server which serves on localhost:8080
.
Navigate the web browser to http://localhost:8080/tests.html
, which runs the unit tests automatically.
You can also run tests using Node.js.
For example:
node
installed in your development environment.