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

Include Modules in building cv.js #41

Open
flefloch opened this issue Jan 17, 2018 · 1 comment
Open

Include Modules in building cv.js #41

flefloch opened this issue Jan 17, 2018 · 1 comment

Comments

@flefloch
Copy link

Hello,

I'm completely new to emscripten so my question may be stupid, but I needed to rebuild the cv.js file to include new haar files.

But when compiling the new file it seems that it didn't include some of the modules since I receive a
cv.VideoCapture is not a constructor
when calling new cv.VideoCapture(this.myVideo);

Did I made something wrong, or is the make.py file provided missing something?

Thank you.

@ocvx
Copy link

ocvx commented Nov 9, 2018

As said here it takes some time to load all the modules, so you should either wait a constant time before executing your function or bind your function to the 'onRuntimeInitialized' event:

const cv = require("./opencv.js");
cv['onRuntimeInitialized']=()=>{
          let mat = new cv.Mat();
          console.log(mat.size());
          mat.delete();
};

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

No branches or pull requests

2 participants