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

Build OpenCV as library #27

Open
adishavit opened this issue Jun 2, 2017 · 9 comments · May be fixed by #37
Open

Build OpenCV as library #27

adishavit opened this issue Jun 2, 2017 · 9 comments · May be fixed by #37

Comments

@adishavit
Copy link

adishavit commented Jun 2, 2017

This is an amazing project, but I think it misses one very important opportunity: Allow people would to build they're OpenCV based project for the browser.

How can I build OpenCV as a library (no bindings), that I can then link to from my own libs?
The bindings/JS-expoting will be done from my own code.

I don't what to program my algorithms in JS, but instead export my C++ code with OpenCV linked internally. How can I do that?

@biggzlar
Copy link

biggzlar commented Jun 2, 2017

Currently working on a modified make.py that does exactly that. It's quite messy but maybe you want to take a look?

If nothing else this is an example of how to build and link opencv during the compilation of your own project.

@adishavit
Copy link
Author

Cool, where do I find it?

@biggzlar
Copy link

biggzlar commented Jun 2, 2017

I'll make it public as soon as I'm back at my desk.

@biggzlar
Copy link

biggzlar commented Jun 2, 2017

https://github.com/biggzlar/opencv_js_compiler

Here you go. As mentioned, this is still in rough shape and there has been almost no testing. The example.cpp file contains some basic image manipulation methods (blur, threshold). Simply run:

python n_make.py example/example.cpp

Once compiled they can be called from within the javascript part in index.html (there is a helper function for html canvas interaction, taking one of the exposed functions as an argument). Just see if you can compile the example and use it in index. Let me know if you hit a bump!

@adishavit
Copy link
Author

What platform do you use this on? Linux? OSX?

@biggzlar
Copy link

biggzlar commented Jun 2, 2017

Usually MacOs, just ran it on Ubuntu Linux and it worked with the latest OpenCV.

@adishavit
Copy link
Author

adishavit commented Jun 3, 2017 via email

@biggzlar
Copy link

biggzlar commented Jun 3, 2017

I didn't have it on there so I did build it from scratch.

@adishavit
Copy link
Author

Works now! Thanks!

@adishavit adishavit reopened this Jun 3, 2017
@Viraj3f Viraj3f linked a pull request Oct 29, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants