paulhayes / copterface

Created during a nodecopter hackday in Brighton. The example script attempts to position an ar-drone so that it centers on any face detected in the center of it's field of vision. EXPERIMENTAL.
MIT License
41 stars 21 forks source link

npm cant install OpenCv #5

Closed RGDEV2022 closed 7 years ago

RGDEV2022 commented 7 years ago

Hi, I know this topic has been discussed everywhere but I cannot get anything to work and I really need some help.

Windows 10 npm 5.4.2

I am trying to get https://github.com/paulhayes/copterface to work for my Ar-Drone

Followed the steps npm install ar-drone npm install opencv

No luck what so ever, pre built binaries not found for opencv@6.0.0 and a whole lot of other errors.

Is there a guide to make this work? I've read a hundred forums here and elsewhere regarding this but it's impossible to make work since the information on this topic is so scattered.

ERROR


opencv@6.0.0 install C:\Users\User\AppData\Roaming\npm\node_modules\opencv node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(403): https://node-opencv.s3.amazonaws.com/opencv/v6.0.0/Release/node-v48-win32-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for opencv@6.0.0 and node@6.10.3 (node-v48 ABI) (falling back to source compile with node-gyp) C:\Users\User\AppData\Roaming\npm\node_modules\opencv\utils\find-opencv.js:57 throw new Error("ERROR: couldn't read the lib directory " + err); ^

Error: ERROR: couldn't read the lib directory Error: ENOENT: no such file or directory, scandir 'C:\opencv\build\x64\vc14\lib' at C:\Users\User\AppData\Roaming\npm\node_modules\opencv\utils\find-opencv.js:57:23 at FSReqWrap.oncomplete (fs.js:123:15) gyp: Call to 'node utils/find-opencv.js --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 10.0.15063 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\User\AppData\Roaming\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64\opencv.node" "--module_name=opencv" "--module_path=C:\Users\User\AppData\Roaming\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64" gyp ERR! cwd C:\Users\User\AppData\Roaming\npm\node_modules\opencv gyp ERR! node -v v6.10.3 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\User\AppData\Roaming\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64\opencv.node --module_name=opencv --module_path=C:\Users\User\AppData\Roaming\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\User\AppData\Roaming\npm\node_modules\opencv\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:106:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:886:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) node-pre-gyp ERR! System Windows_NT 10.0.15063 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\User\AppData\Roaming\npm\node_modules\opencv\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\Users\User\AppData\Roaming\npm\node_modules\opencv node-pre-gyp ERR! node -v v6.10.3 node-pre-gyp ERR! node-pre-gyp -v v0.6.38 node-pre-gyp ERR! not ok Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\User\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\User\AppData\Roaming\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64\opencv.node --module_name=opencv --module_path=C:\Users\User\AppData\Roaming\npm\node_modules\opencv\build\opencv\v6.0.0\Release\node-v48-win32-x64' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! opencv@6.0.0 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the opencv@6.0.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2017-10-06T15_46_47_034Z-debug.log


Any help would be greatly appreciated.

paulhayes commented 7 years ago

Good news, that README is totally out of date. The project no longer uses openCV and instead uses jsfeat which is an excellent native javascript library for image detection.

please install dependancies by calling npm install from the project directory

paulhayes commented 7 years ago

I've updated the example. Please have a look and I hope the new README helps with using this library.

RGDEV2022 commented 7 years ago

Thank you so much for your help. I will test this out. I’m also trying to do recognition on a RPi and send commands of movement to the drone through WiFi. Is there anyway of doing this?

On Sat, Oct 7, 2017 at 6:39 PM Paul Hayes notifications@github.com wrote:

I've updated the example. Please have a look and I hope the new README helps with using this library.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulhayes/copterface/issues/5#issuecomment-334972781, or mute the thread https://github.com/notifications/unsubscribe-auth/AJeI8hxVxqKi_uP24_RRQbTqD2FZRM-8ks5sqAuegaJpZM4Pwrdb .

paulhayes commented 7 years ago

Yes this is possible. This library should work. You do have to have ffmpeg installed as well.

I have a raspberry pi zero wireless. So if you run into problems I might be able to help.

RGDEV2022 commented 7 years ago

Okay I’m sorry for bothering you but how would I change your program to make this work? How would I use a Pi cam mounted on the drone and hooked up to a Pi to make the detections and make the drone move?

On Sat, Oct 7, 2017 at 7:17 PM Paul Hayes notifications@github.com wrote:

Yes this is possible. This library should work. You do have to have ffmpeg installed as well.

I have a raspberry pi zero wireless. So if you run into problems I might be able to help.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulhayes/copterface/issues/5#issuecomment-334974205, or mute the thread https://github.com/notifications/unsubscribe-auth/AJeI8qy9TI7u5hXusiZE7BlhVIFXnXhyks5sqBSLgaJpZM4Pwrdb .

RGDEV2022 commented 7 years ago

Let me explain what I’m trying to do. I’m a senior Mechanical engineering student at Midwestern State University. I’m trying to make multiple AR drones go search for people who are lost. I’m using Goolges tensor flow to make these drones smart and communicate with each. I’m good with tensor flow but I have absolutely no experience with using facial rec on an AR Drone. I’ve tried learning but it looks like a complete headache using Opencv. Then I came across your project and it seemed ingenious! It’s the perfect solution to my project. If you could please help me figure out how to do facial rec using a Pi cam and RPi and make the drone move accordingly I would greatly appreciate it add your name to my paper and conference presentations. That’s the least I could do for your help.

On Sat, Oct 7, 2017 at 9:36 PM Rojitha Goonesekere rojitha.g@gmail.com wrote:

Okay I’m sorry for bothering you but how would I change your program to make this work? How would I use a Pi cam mounted on the drone and hooked up to a Pi to make the detections and make the drone move?

On Sat, Oct 7, 2017 at 7:17 PM Paul Hayes notifications@github.com wrote:

Yes this is possible. This library should work. You do have to have ffmpeg installed as well.

I have a raspberry pi zero wireless. So if you run into problems I might be able to help.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulhayes/copterface/issues/5#issuecomment-334974205, or mute the thread https://github.com/notifications/unsubscribe-auth/AJeI8qy9TI7u5hXusiZE7BlhVIFXnXhyks5sqBSLgaJpZM4Pwrdb .

paulhayes commented 7 years ago

Okay so I would say you potentially don't need the rasp pi cam, as a raspberry pi zero wireless could be fitted to the drone and use the drones on board camera. That's if you're using the Parrot 2 AR Drone that this project was made for. You can even power the pi directly from the drones systems. However if you have another type of drone, there might be much better ways ( this drone in kind of ancient now )

If this is the drone for you there are some other things to consider. You might not have enough processing power on the raspberry pi to run tensor flow and do the realtime computer vision part. However it might be achievable if you only do the TF facial recognition occasionally once you've captured a face from an ideal position.

In terms of the nitty gritty. The raspberry pi zero W can be easily configured to automatically connect to a specific SSID. You can set the SSID of a Parrot drone using the mobile app. Then this library could automatically wireless connect to the drone and send flying commands.

During development, I'd run the raspberry pi zero with a usb hub with keyboard and mouse, and plug in a screen, while connected to drone on it's wifi. Then have another computer for internet access for research and documentation reading. Keep all your project regularly version controlled though, because the raspberry pi can destroy SD cards when power cycling ( I have a 64GB, 32GB and 16GB card all dead from stupid power cycling issues, I take much more care now ).

I'm imaging once the drone has spotted someone and moved to an ideal position then it will write the image of their face to disk and start up the tensor flow program to identify the face.

However the larger problems are that the drones need to navigate physical space, and I'm not sure the pi has got the processing power for that much computer vision. As it needs to use it's camera to avoid obsticles etc.

In terms of GPS. There is a gps backpack for the Parrot AR drone. I'm not sure, but I think that does get sent with the navdata to the connected device, so you could use that data in your project. But I've not tried that so it's not something I can say definitively.

yours Paul

RGDEV2022 commented 7 years ago

Hi, thank you so much for taking the time to explain things to me. I may have to change my approach to this problem after you mentioned the processing power issue. And yes I’m using an AR Drone mainly because of its price point (is there another drone you would recommend?) Also I wanted to use a Pi cam because I was hoping to use an Adafruit pan and tilt mounted on the bottom of the drone. So ideally when the pan and tilt can’t see the person anymore I want the drone to move to find the person. I honestly don’t know where to start for this, how would I begin?

Thanks!

On Sun, Oct 8, 2017 at 5:58 AM Paul Hayes notifications@github.com wrote:

Okay so I would say you potentially don't need the rasp pi cam, as a raspberry pi zero wireless could be fitted to the drone and use the drones on board camera. That's if you're using the Parrot 2 AR Drone that this project was made for. You can even power the pi directly from the drones systems. However if you have another type of drone, there might be much better ways ( this drone in kind of ancient now )

If this is the drone for you there are some other things to consider. You might not have enough processing power on the raspberry pi to run tensor flow and do the realtime computer vision part. However it might be achievable if you only do the TF facial recognition occasionally once you've captured a face from an ideal position.

In terms of the nitty gritty. The raspberry pi zero W can be easily configured to automatically connect to a specific SSID. You can set the SSID of a Parrot drone using the mobile app. Then this library could automatically wireless connect to the drone and send flying commands.

During development, I'd run the raspberry pi zero with a usb hub with keyboard and mouse, and plug in a screen, while connected to drone on it's wifi. Then have another computer for internet access for research and documentation reading. Keep all your project regularly version controlled though, because the raspberry pi can destroy SD cards when power cycling ( I have a 64GB, 32GB and 16GB card all dead from stupid power cycling issues, I take much more care now ).

I'm imaging once the drone has spotted someone and moved to an ideal position then it will write the image of their face to disk and start up the tensor flow program to identify the face.

However the larger problems are that the drones need to navigate physical space, and I'm not sure the pi has got the processing power for that much computer vision. As it needs to use it's camera to avoid obsticles etc.

In terms of GPS. There is a gps backpack for the Parrot AR drone. I'm not sure, but I think that does get sent with the navdata to the connected device, so you could use that data in your project. But I've not tried that so it's not something I can say definitively.

yours

Paul

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/paulhayes/copterface/issues/5#issuecomment-334998606, or mute the thread https://github.com/notifications/unsubscribe-auth/AJeI8kniw7-HOBAeLKj00OD28JbPRvINks5sqKrXgaJpZM4Pwrdb .