Skip to content
ganwenyao edited this page Jun 27, 2017 · 15 revisions

Install Emscripten

Follow step 2, 3, 4 of https://github.com/ucisysarch/opencvjs#how-to-build

Download code

$ git clone https://github.com/huningxin/opencv.git

Build

$ cd opencv
$ mkdir build_js
$ cd build_js
$ cmake -D CMAKE_TOOLCHAIN_FILE=${EMSCRIPTEN}/cmake/Modules/Platform/Emscripten.cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
$ make -j7

Test

In browser

$ cd bin
$ python serve.py

Launch browser to http://localhost:8000.

Tests include:

  • tests.html
  • features_2d.html
  • img_proc.html
  • face_detect.html

In Node.js

$ cd bin
$ npm install
$ node tests.js

Build Documentation

This will create offline version of OpenCV's complete official documentation in HTML. First, install Doxygen (a documentation generation tool).

$ apt-get install doxygen

Then, in build_js folder

$ make doxygen

Then open doc/doxygen/html/index.html in the browser.

Clone this wiki locally