In general, when you compile an emscripten program it will look for the Module variable in the global namespace. You can populate that with various settings and values, (including the wasm memory),
https://kripken.github.io/emscripten-site/docs/api_reference/module.html So just including two emscripten-compiled programs in two separate script tags will lead to both looking at Module, and after the first uses it, the second will be influenced by that. When using more than one emscripten-compiled program on the same page, it's a good idea to use the MODULARIZE option, https://github.com/kripken/emscripten/blob/incoming/src/settings.js#L579 On Thu, Aug 2, 2018 at 11:35 AM, Jendker <[email protected]> wrote: > The problem is solved (I will use different namespace for each module), > but I am having a more general question about the correct approach (this > would be rather the question to someone working with opencv/opencv.js): > > If I am using opencv.js as described here (https://docs.opencv.org/3.4/ > dd/d00/tutorial_js_video_display.html) to get images from camera. > I would like to process the frames in the C++ function binded with Embind, > because then I can use the same functions to conveniently debug the code > locally. > > - Is it possible to compile such code (opencv.js and my Embind functions), > to have everything in one module? > - I am having the problem with passing the cv.Mat objects from camera > (read with opencv.js (https://docs.opencv.org/3.4/ > dd/d00/tutorial_js_video_display.html)) to Embind(ed) functions, I am > getting "Uncaught UnboundTypeError: Cannot call XXX due to unbound > types". The cv::Mat type between both is not compatible. Should I get the > vector of all elements and pass it to Embind function? This sounds like > unnecessary overhead... How to do it in a neater way? > > Thank you very much for your help! > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
