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

Properly detect when OpenCV is ready #45

Open
habbes opened this issue Jun 9, 2018 · 0 comments
Open

Properly detect when OpenCV is ready #45

habbes opened this issue Jun 9, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@habbes
Copy link
Owner

habbes commented Jun 9, 2018

At the moment, the app detects when OpenCV is ready by passing a callback to the onload handler of the async script tag used to load opencv.js.

However, even though OpenCV is loaded, not all its APIs are ready for use, for example, cv.Mat may not be ready when the callback is called.

According to this post cv['onRuntimeInitialized'] can be used to assign a callback which will be fired when the APIs area ready for use:

cv.onRuntimeInitialized = () => {
   // cv is ready
};

No issue has occurred yet because of this, since by the time the editor is loaded and code executed, OpenCV will have had enough time to load, but I foresee it causing issues if we have code that is executed when the app is being setup.

@habbes habbes added the bug Something isn't working label Jun 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant