opencv4nodejs icon indicating copy to clipboard operation
opencv4nodejs copied to clipboard

Almost got opencv4nodejs up and running, but have file structure errors when starting the app

Open justinmeskan opened this issue 2 years ago • 3 comments

I am getting stuck here, I have followed the instructions to a T, and there is some sort of mismatch in the file structure? Are there certain versions of compatible packages that I should use together? I have disabled auto-build, I'm using a mac with an intel chip, I have unlinked Tesaract, installed OpenCV and opencv@2. I want to get a good face detection and face mesh for large groups of people in videos of course. But do it all with Nodejs. What I am using now runs in the browser and I can only get 4 people masked at the most. Love what you're doing here and I hope I can help in any way.

Also when I installed "opencv4nodejs" globally and tried locally. there are lots of warnings and a few errors, I'm not sure if that's just over logging or I'm breaking lots of things.

/node_modules/opencv4nodejs/lib/cv.js:47 throw err ^

Error: Cannot find module '/node_modules/opencv4nodejs/build/Release/opencv4nodejs' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/node_modules/opencv4nodejs/lib/cv.js:40:8) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

justinmeskan avatar Oct 13 '21 01:10 justinmeskan

I tried tried figuring this out (since I got the same issue).

I described what worked for me here: https://github.com/justadudewhohacks/opencv4nodejs/issues/538#issuecomment-1015480008

I got opencv4nodejs working on my M1 Max MacBook running node.js@v16.

chrisspiegl avatar Jan 18 '22 14:01 chrisspiegl

opencv4nodejs can not be installed globally; I did not patch that in my fork because I use a new env variable named OPENCV_BUILD_ROOT:

export OPENCV_BUILD_ROOT="~/OpenCV"

So all my builds are made outside of my node_modules and are shared between all my projects.

@u4/opencv4nodejs

UrielCh avatar Jan 19 '22 08:01 UrielCh

@UrielCh This sounds very promising 👍.

chrisspiegl avatar Jan 21 '22 17:01 chrisspiegl