Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

WebAssembly OpenCV.js and camera processing with Embind-ed C++ functions

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!

WebAssembly OpenCV.js and camera processing with Embind-ed C++ functions

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". types: N2cv3MatE". The cv::Mat type between both opencv.js and c++ code is not compatible. compatible (a pity). 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!