我正在使用node.js和electron来构建桌面应用程序。我想用它来使用OpenCV。我成功安装了opencv4nodejs,现在我希望cv.Mat在HTML5 Canvas中呈现。是否可以直接执行,或者我必须保存图像然后再渲染它。
还有一个问题是opencv4nodejs在node.js控制台中工作得很好,但是它不能用于电子它会给我带来错误:
Uncaught Error: The system cannot find message text for message number 0x%1 in the message file for %2. Electron_ASAR.js
\\?\D:\Mohit\Projects\Devide\node_modules\opencv4nodejs\build\Release\opencv4nodejs.node
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (D:\Mohit\Projects\Devide\node_modules\opencv4nodejs\lib\opencv4nodejs.js:13:8)
at Object.<anonymous> (D:\Mohit\Projects\Devide\node_modules\opencv4nodejs\lib\opencv4nodejs.js:31:3)
是的,有可能这样做。您可能没有看到使用opencv4nodejs与电子:opencv-electron的示例repo。此外,在自述文件中也给出了将cv.Mat呈现为html5画布的步骤。
关于您的错误,您必须在本机程序包上运行电子重建。这在自述文件中也有解释。