Hey, I just came across your articles about OpenCV in JavaScript and thus across this library. They were great, so keep doing them :)
This issue is no real issue with the library. Just looking for some clarification here, because I wanted to start using OpenCV in JS: How is this version different from https://github.com/ucisysarch/opencvjs ?
Hi, thanks for the feedback!
opencvjs (the repo you linked) is a project, which allows you to run a subset of the OpenCV API in a browser. Basically they have compiled OpenCV C++ code to a) asm.js and b) webassembly.
asm.js basically is a subset of javascript, which can be run by chrome and firefox for example. asm.js has slightly better performance then plain javascript. In case the browser does not support asm.js optimizations it will simply run it as plain javascript.
webassembly is a spec, which allows you to run close to native code in a browser , which is supposed to have much better performance then asm.js. One downside of that is that the binary has to be shipped down to the client and once received, has to be compiled in the browser, which I found to increase the initial page loading time significantly. Furthermore it seems to only really be supported by firefox at the moment, the performance in chrome is much worse.
opencv4nodejs however is basically a wrapper library which allows you to use the native C++ library via a javascript API in nodejs. This package has native performance and an asynchronous, non-blocking API. You can even do multithreading with it. Being a native nodejs package, you can not use opencv4nodejs in a browser.
Simply put: if you have to use OpenCV in the browser, you can give opencvjs a try. Otherwise you are better of using this package.
Perfect explanation. Thank you for the clarification and your time :) Keep up the great work! 馃憤
Most helpful comment
Hi, thanks for the feedback!
opencvjs (the repo you linked) is a project, which allows you to run a subset of the OpenCV API in a browser. Basically they have compiled OpenCV C++ code to a) asm.js and b) webassembly.
asm.js basically is a subset of javascript, which can be run by chrome and firefox for example. asm.js has slightly better performance then plain javascript. In case the browser does not support asm.js optimizations it will simply run it as plain javascript.
webassembly is a spec, which allows you to run close to native code in a browser , which is supposed to have much better performance then asm.js. One downside of that is that the binary has to be shipped down to the client and once received, has to be compiled in the browser, which I found to increase the initial page loading time significantly. Furthermore it seems to only really be supported by firefox at the moment, the performance in chrome is much worse.
opencv4nodejs however is basically a wrapper library which allows you to use the native C++ library via a javascript API in nodejs. This package has native performance and an asynchronous, non-blocking API. You can even do multithreading with it. Being a native nodejs package, you can not use opencv4nodejs in a browser.
Simply put: if you have to use OpenCV in the browser, you can give opencvjs a try. Otherwise you are better of using this package.