Search code examples
c++node.jsopencvv8

Should I wrap a C++ object that is contained entirely inside a node.js function


I am trying to write an extension to node.js.
I want to have a function that reads an image (I'm using opencv) computes something and returns a value, so the input is a string and the number is a number.
Should I wrap opencv's Mat for doing that?
I managed to read an image, but when I am trying to resize it (using cv::resize) I get an exception:

C:...\NodeEngine.node
at Object..node (module.js:474:11)

My setup is Windows 7 64 bit, Visual Studio 2010 (I am compiling a 64bit extension)

Thanks


Solution

  • No, I would not wrap Mat for such a simple use case. Sounds like what you need to do can be done in a simple method without mapping a C++ object.

    It's hard to tell where the exception comes from without some code.