Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically Generated Bindings #290

Open
Queuecumber opened this issue Sep 1, 2015 · 8 comments
Open

Automatically Generated Bindings #290

Queuecumber opened this issue Sep 1, 2015 · 8 comments

Comments

@Queuecumber
Copy link
Collaborator

Something I've been looking into for a little while. The OpenCV build process generates python and matlab bindings automatically from the C++ source. One of the issues these JS bindings seem to have is lack of feature support. What do you think about cutting a new version that can do a similar automatic generation for javascript?

Of course this would be very much incompatible with the current JS api, but we would theoretically be able to support most if not all of the features and they would match the C++ api closer

@aaaristo
Copy link

aaaristo commented Oct 1, 2015

@ylh888
Copy link

ylh888 commented Dec 29, 2015

I don't mean to populate the Issues page here. I'm currently having to wade through the Examples to find ways of doing things. Is there a list of implemented functions? Please see my question here http://stackoverflow.com/questions/34518140/list-of-node-opencv-function-names

@johncant
Copy link

Is there any reason why we couldn't generate Javascript bindings from the same tool, then augment them to add things like async calls and streaming? Has anyone tried this?

@johncant
Copy link

Hi @Queuecumber , here's my effort so far:

https://github.com/johncant/opencv/tree/node_bindings

Essentially, all I've done so far is copied and pasted bits of cmake involved in the Python bindings generation to get to the point where the node bindings would be generated. My plan is:

  • Hack gen2.py to produce safe C++ for use with node.js
  • Produce typescript definitions
  • Also produce an async version of every function (saves having to manually annotate anything)
  • Get it to compile
  • The next step I'm a bit unsure of. Maybe an npm module is necessary for people to put in their package.json . Its only function would be to find the installed bindings and require them. Or, maybe a script to turn opencv into a standalone node module that publishes itself.

@johncant
Copy link

There's also supposed to be a way of getting OpenCV to compile to Javascript using Emscripten but I can't find any info on it.

@danschultzer
Copy link
Collaborator

Did you get any further with this @johncant? I like this approach.

@danschultzer
Copy link
Collaborator

Found this library that seems to generate bindings automatically 🚀 https://github.com/ucisysarch/opencvjs

@darkdragon-001
Copy link

Another approach would be to do it similar to the Matlab bindings. This module is very well documented in the official opencv_contrib repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants