Comments (4)
Hi,
I have tried adapting the compilation instructions (in the readme) and adapted a few files to add WebAssembly support. The result is here: https://github.com/njor/opencvjs
The new compiled files can be found already built in the build folder here: https://github.com/njor/opencvjs/tree/master/build
from opencvjs.
Hi njor,
I'm glad to read that there now also is a webassembly version. I'm absolutely excited to test it.
I'm aware that importing wasm modules is a bit bulky at the moment (https://developer.mozilla.org/en-US/docs/WebAssembly/Loading_and_running)... So far I cannot imagine how to use the constructors (like so far "new cv.Mat()"...
Do you have a minimal working example, like define a Mat and do some operation on it?
This would surely save me immense amount of time.
Many thanks in advance...
from opencvjs.
Hi drhouse82,
The loading / initialization of the wasm module is taken care of by emscripten. The only thing you need to do is to create a global Module object with your configuration (see here for the details : https://kripken.github.io/emscripten-site/docs/api_reference/module.html), and then include the generated javascript file (cv-wasm.js) with a script tag.
You can find some examples in the test directory, and I have written a minimal working example to try and document the API slightly better, here : https://github.com/njor/opencvjs/blob/master/test/minimal-example.html
(But I am far from an expert, and am still struggling from time to time to understand the way emscripten binds stuff to JS. Oh well.)
Anyways, have fun. ^^
from opencvjs.
Hi njor,
thank you very much! works like a charm!
I somehow thought module loading was not yet ready... very nice!
Thanks again!
from opencvjs.
Related Issues (20)
- Question: Support for video frame as input
- HogDescriptor
- Emscripten link issue in make.py
- Error: function matFromArray called with 4 arguments, expected 2 args
- Module is not defined
- patch_emscripten_master not working for new version of Emscripten SDK. HOT 2
- Could not work on Google Chrome HOT 1
- opencvjs is working in dev mode with react but it is not built!
- All functions except cv.imread() and cv.imshow() throw exception like " Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch. "
- Add Support for aruco Markers HOT 2
- Error while allocating new cv.Mat
- Difference between official OpenCV.js
- "fs" dependency causing compiling error HOT 3
- How can i use opencv.js with my own function build with opencv c++ HOT 1
- how to set puttext to korean?
- does opencvjs contains functions: findHomography() & decomposeHomographyMat?
- .matchTemplate with a mask fails with error HOT 1
- cant perform inRange operation on HSV image.
- detectMultiScale3 port
- opencv not compatible with vitejs bundler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencvjs.