GithubHelp home page GithubHelp logo

paulhayes / copterface Goto Github PK

View Code? Open in Web Editor NEW
41.0 5.0 22.0 33 KB

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.

License: MIT License

JavaScript 100.00%

copterface's Introduction

Copterface

Facial recognition for Parrot AR Drone 2.0 Build Status

Installing

npm install copterface

or checkout from github

git clone [email protected]:paulhayes/copterface.git

Running Example

node node_modules/copterface/example.js

Using the library

Add it to your node project

npm install copterface --save

Here's a simple example, showing how you can use copterface

const client = arDrone.createClient({imageSize:"160x90"});
const pngStream = client.getPngStream();
var copterface = new Copterface(pngStream,{},function(info){
    console.log(info);
});

copterface.start();

CopterFace(pngStream,options,callback)

options an object with the following optional key/value pairs :
  • outputImage ( boolean ), whether to generate a debug png and include in the info object passed to callback.
callback an function that recieves the info object :
  • info.rects an array of normalized rects for each face identifed
  • info.image included if the outputImage flag is set to true. This is a PNG object that has had it's pack method called and will be emitting 'data' and 'end' events.

copterface's People

Contributors

dwhu avatar paulhayes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

copterface's Issues

npm cant install OpenCv

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 [email protected] 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


[email protected] 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 [email protected] and [email protected] (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! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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.

Drone moves back without reacting to a face

HI, I ran the example.js and the drone takes off and continues to move back. On the debugging video even though it detects my face, it doesn't react. It just keeps moving back.
I tried it with another AR-drone I have and in that one the drone moves to the left continuously without reacting to my face.
Any help would be much appreciated, it's for a college project.

Question about the code

Hi Paul,

That's really cool, I'm trying to do something similar, but with unknown objects that I assign using stylus on the canvas.
So, I was trying to find the part that controlling the drone so that the face will be in the middle of the camera streaming but I couldn't find it or may be I miss understand what you are trying to do here. So is there any part in your code that attempts to control the drone so that to make the face in the middle of the png stream with a certain ratio?

Thanks in advance,

Getting error when trying to install opencv

Hi there !
I got an error when I try to install opencv. It said that node-gyp fails to rebuild the repo.
Because I don't have the package node-gyp installed in my system and I can't install it.
See my screenshot :

opencv_error

Plz help me, I don't have any idea to solve this problem. I am new in that field.
Thanks

Getting errors

Hi, I'm hoping you can help I'm the following errors on instal

Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found gyp: Call to 'pkg-config --cflags opencv' returned exit status 1. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:424:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean" "rebuild"
gyp ERR! cwd /Users/macbookpro/node_modules/opencv
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.