Ask Your Question

OpenCV support across languages, particularly Javascript

asked 2019-08-27 15:38:38 -0500

djam gravatar image

OpenCV has been implemented in many languages, I wonder if there is a breakdown by implemented features across languages. I am particularly interested in Javascript support and how the support for JS API differs from, say Python.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-08-29 15:40:31 -0500

cancerberosgx gravatar image

Lately I was working with opencv.js (my first encounter with opencv) and since the project has awesome documentation I focused on extracting the types, signatures and descriptions to TypeScript declarations so JavaScript /TypeScript has type checking/autocompletion, etc. I think now I have a descent version of the typings, that are genrated automatically from opencv js build.

Now that i have descent types I finally can enjoy learning the project's APIs relatively confortable using TypeScript. The project also provides support for node.js using the same code/apis. At some point I will send a PR to opencv project with this although I will need to reserve some time since probably this involves discussions and lots of changes.

My impression with opencv.js in particular is that, reasonably put strong focus in the browser. For example, machine learning module (and in general those designed to training) are not supported. But it has good support for most general (consumer) cases and the API is almost a straight forward translation from C's and generated automatically. What I didn't like it so much is that, it has a browser layer implemented too close to the wasm (it unnecesary pollutes the wasm file), and is too attached to the build. It's a very lightweight layer.Since it's a thin layer I think it can easily be moved to an independent module that just consumes the build output without impacting in the process and make it dependant on concrete technologies - I know it probably was made to support the great examples in the docs but it has currently great impact on the way the wasm is loaded, consumed and build. I will try to PR with a proposal but BTW I didn't tough that part yet,.. currently I'm using the same opencv.js output in my project.

Nevertheless this is just a detail, as a newbie in this topic I'm amazed with what I can accomplish using the camera in real time or loading trained models form third parties and there are some APIs that work like magic in the browser, very fast and with acceptable memory consumption. You can try several examples in the playground being able to edit and run them online - and share the links

My two cents. I would also love to hear more about the experience of other opencv.js users

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-27 15:38:38 -0500

Seen: 19 times

Last updated: Aug 27