In this branch, we are going to combine opencv with emscripten to enable opencv's rich features in javascript's world.
We are going to
- Export Mat by Embinding. (Working)
- Export the first layer modules by Embinding.
Emscripten installation guide from Emscripten.org
Version 1.29 and above is recommended for better performance.
At the root folder of opencv source code. $ mkdir jsobj $ cd jsobj $ emcmake cmake .. $ emmake make
You will find opencv.js in ${jsobj}/lib folder. By Including this js library in HTML or require it in js, you can start using opencv.
You may use opencv.js in firefox/ chrome or node.js.
In node.js
$ node > var Module = require('./opencv.js'); > var mat = new Module.Mat(10, 10, Module.CV_8UC3) > mat.channels() 3
JS test suite is put in module/js/test. There are many tests in test suite, and those tests are good reference of how to using opencv module by javascript.
I am constructing a js app, in sample/js folder, which demostrate the usage of image-proc module.
- Automatic binding code generator. I don't want to manually generate bind code for each function that we want to export onto javascript.
- Matrix operation.(MatExpr)