Giter VIP home page Giter VIP logo

node-opencv's People

Contributors

ad-si avatar alvarezgarcia avatar amilajack avatar andreasgal avatar bbb avatar borromeotlhs avatar btsimonh avatar danschultzer avatar dstarke avatar dxprog avatar edgarsilva avatar evilcat-x avatar funky81 avatar jhludwig avatar jspdown avatar kaosat-dev avatar keeganbrown avatar madshall avatar marcbachmann avatar morganrallen avatar oskardahlberg avatar peterbraden avatar piercus avatar queuecumber avatar rnelord avatar sonicdoe avatar thomashoffmann1979 avatar timfpark avatar wenq1 avatar woolite64 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-opencv's Issues

VideoCaptureWrap

I wonder will you have a VideoCapture example? i using node-opencv and html5 video for real-time face detection, readimage is very slow for real-time detect.

Convert Matrices to Raw Buffers

It would be very useful to be able to pull the raw bytes out of the lblImage and stuff them into a node Buffer.

A use case scenario would involve a situation where you want to take the raw bytes from a frame and send the out over the network using UDP.

Sample:
var buffer;
var camera = new cv.VideoCapture(0);
camera.read(function(image){
buffer = image.getBytes();
});

Thanks.

Ability to change resolution of captured image

First off, thanks for writing node-opencv - great package to use so far.

I can't seem to find a way to change the resolution of the captured image using VideoCapture - is there a way that I'm missing to set the resolution of the images that are captured by the camera? By default, i'm getting image matrices of 160x120 which obviously is lower than ideal.

Many apologies in advance if this is obvious and I missed it in one of the examples or docs.

error: ‘eio_req’ has not been declared

Hi

Getting the following error on installation

CXX(target) Release/obj.target/opencv/src/init.o
In file included from ../src/init.cc:4:0:
../src/CascadeClassifierWrap.h:16:35: error: ‘eio_req’ has not been declared
../src/CascadeClassifierWrap.h:17:39: error: ‘eio_req’ has not been declared
make: *** [Release/obj.target/opencv/src/init.o] Error 1

unable to run example

When I try to run your example I get an error:

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unable to load shared library /home/ara/projects/other/node-opencv/node_modules/opencv/build/Release/opencv.node
at Object..node (module.js:472:11)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object. (/home/ara/projects/other/node-opencv/node_modules/opencv/lib/bindings.js:1:80)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)

Can you help me?

Error in installing node open cv in windows

Can you please help me with the installation of node opencv
I have opencv installed which I can access from python. It is in d:\opencv
When I try to issue the command c:\npm install opencv I get errors which is given below

C:>npm install opencv
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No readme data.
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv
npm WARN package.json [email protected] No repository field.

[email protected] preinstall C:\node_modules\opencv
node-gyp clean rebuild

C:\node_modules\opencv>node "C:\Program Files\nodejs\node_modules\npm\bin\node-g
yp-bin....\node_modules\node-gyp\bin\node-gyp.js" clean rebuild
'pkg-config' is not recognized as an internal or external command,
operable program or batch file.
gyp: Call to 'pkg-config --cflags "opencv >= 2.3.1"' returned exit status 1. whi
le 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:\Program Files\nodejs\node_module
s\npm\node_modules\node-gyp\lib\configure.js:415: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 Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "clean" "rebuild"
gyp ERR! cwd C:\node_modules\opencv
gyp ERR! node -v v0.10.7
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

Open cv is working fine with python

problem installing opencv on windows

I get error when trying to install on windows 7 64 bit python 27

Here are the error screenshot i got:
Capture

I can install node-gyp just fine, and also other node modules. I also have opencv installed, which i tested with python

Any idea?

OpenCV Error: Bad argument

Hi! When i'm install node-opencv with npm and trying to use VideoCapture() my script is breaks up and show this error:
OpenCV Error: Bad argument (Invalid cascade pointer) in cvRunHaarClassifierCascadeSum, file /build/buildd/opencv-2.3.1/modules/objdetect/src/haar.cpp, line 668 terminate called after throwing an instance of 'tbb::captured_exception' what(): /build/buildd/opencv-2.3.1/modules/objdetect/src/haar.cpp:668: error: (-5) Invalid cascade pointer in function cvRunHaarClassifierCascadeSum

But when i'm downloaded it from Github and build with node-gyp everything is okay.
Thanks. Sorry for my bad english.

Problem installing opencv

Hi, I'm getting the following errors when trying to install opencv on an Ubuntu virtual machine:

vagrant@lucid32:/usr$ sudo npm install opencv
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv

[email protected] preinstall /usr/node_modules/opencv
node-gyp clean rebuild

/bin/sh: pkg-config: not found
gyp: Call to 'pkg-config --cflags --libs "opencv >= 2.3.1"' returned exit status 127. 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/lib/nodejs/npm/node_modules/node-gyp/lib/configure.js:416:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Linux 2.6.32-38-generic
gyp ERR! command "node" "/usr/lib/nodejs/npm/node_modules/node-gyp/bin/node-gyp.js" "clean" "rebuild"
gyp ERR! cwd /usr/node_modules/opencv
gyp ERR! node -v v0.8.21
gyp ERR! node-gyp -v v0.8.4
gyp ERR! not ok
npm ERR! [email protected] preinstall: node-gyp clean rebuild
npm ERR! sh "-c" "node-gyp clean rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the opencv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp clean rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls opencv
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-38-generic
npm ERR! command "nodejs" "/usr/bin/npm" "install" "opencv"
npm ERR! cwd /usr
npm ERR! node -v v0.8.21
npm ERR! npm -v 1.2.12
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/npm-debug.log
npm ERR! not ok code 0

OpenCV Error: Null pointer (Hidden cascade has not been created. Use cvSetImagesForHaarClassifierCascade)

OpenCV Error: Null pointer (Hidden cascade has not been created.
Use cvSetImagesForHaarClassifierCascade) in cvRunHaarClassifierCascadeSum, file /tmp/opencv-pKns/OpenCV-2.4.2/modules/objdetect/src/haar.cpp, line 671
libc++abi.dylib: terminate called throwing an exception
Abort trap: 6

I get this when running

cv = require 'opencv'

buf = (some png buffer)

cv.readImage buf, (err, im) ->
      return cb err if err?
      im.detectObject "./haarcascade_frontalface_alt.xml", {}, (err, faces) ->
        return cb err if err?
        return cb null, faces

cv::floodFill

I want to add the function cv::floodFill but I do not know how your coding style.
I do this

mat.floodFill([1,1] ,[255,0,0] ,[[0,2],[30,40]] ,[8,90,60], [10,100,70]);

But it is not clear, so I thought about it

mat.floodFill( { seedPoint: [1,1]   ,  
      newColor: [255,0,0] ,
      rect:[[0,2],[30,40]] ,
      loDiff : [8,90,60], 
      upDiff:[10,100,70]  
} );

Got an error when installing the new version

Macbook-Pro-Retina-2:node_modules qrpike$ sudo npm install opencv
Password:
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv

> [email protected] preinstall /Users/qrpike/node/node_modules/opencv
> node-gyp clean rebuild

/bin/sh: pkg-config: command not found
Traceback (most recent call last):
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/gyp", line 18, in <module>
    sys.exit(gyp.main(sys.argv[1:]))
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/__init__.py", line 511, in main
    return gyp_main(args)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/__init__.py", line 494, in gyp_main
    options.circular_check)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/__init__.py", line 133, in Load
    depth, generator_input_info, check, circular_check)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 2378, in Load
    depth, check)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 384, in LoadTargetBuildFile
    build_file_data, PHASE_EARLY, variables, build_file_path)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 1053, in ProcessVariablesAndConditionsInDict
    build_file)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 1068, in ProcessVariablesAndConditionsInList
    ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 1027, in ProcessVariablesAndConditionsInDict
    ProcessConditionsInDict(the_dict, phase, variables, build_file)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 904, in ProcessConditionsInDict
    variables, build_file)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 1046, in ProcessVariablesAndConditionsInDict
    build_file, key)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 1053, in ProcessVariablesAndConditionsInDict
    build_file)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 1072, in ProcessVariablesAndConditionsInList
    expanded = ExpandVariables(item, phase, variables, build_file)
  File "/Users/qrpike/.node-gyp/0.8.16/tools/gyp/pylib/gyp/input.py", line 714, in ExpandVariables
    (contents, p.returncode))
Exception: Call to 'pkg-config --cflags opencv' returned exit status 127. 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:395:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack     at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Darwin 12.2.1
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean" "rebuild"
gyp ERR! cwd /Users/qrpike/node/node_modules/opencv
gyp ERR! node -v v0.8.16
gyp ERR! node-gyp -v v0.7.3
gyp ERR! not ok 
npm ERR! [email protected] preinstall: `node-gyp clean rebuild`
npm ERR! `sh "-c" "node-gyp clean rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the opencv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp clean rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls opencv
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.2.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "opencv"
npm ERR! cwd /Users/qrpike/node/node_modules
npm ERR! node -v v0.8.16
npm ERR! npm -v 1.1.69
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/qrpike/node/node_modules/npm-debug.log
npm ERR! not ok code 0```

How to augment a live video stream?

I've see demos that live stream video and use OpenCV to create overlays on that video. What is the best way to do this with the node bindings? Is streaming video to a browser the best way to view it? Does anyone have an example of augmenting live video? Thanks!

Error on npm install: "Package 'opencv' has no Name: field"

Hi All - very excited about using opencv with node, but I'm getting an install error:

os: windows 7
terminal: cygwin

error:

C:\Users\rtalaman\AppData\Roaming\npm\node_modules\opencv>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" clean rebuild
Package 'opencv' has no Name: field
gyp: Call to 'pkg-config --cflags "opencv >= 2.3.1"' returned exit status 1. while trying to load binding.gyp
npm ERR! [email protected] preinstall: node-gyp clean rebuild
npm ERR! cmd "/c" "node-gyp clean rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the opencv package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp clean rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls opencv
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "opencv"
npm ERR! cwd C:\cygwin\home\rtalaman
npm ERR! node -v v0.8.17
npm ERR! npm -v 1.2.0
npm ERR! code ELIFECYCLE

I checked out the github and the manifest indeed has a Name, so I'm not sure what could be throwing this error. Any help is appreciated.
Thanks - Robert

Make library calls asynchronous?

The current calls are synchronous, blocking the io loop during processing. Would there be any possibility to convert this to asynchronous calls?

Should this be a completely different implementation, or could this library be updated to support aync requests?

I have absolutely no experience in nodejs native bindings, so maybe this is not even possible. If anyone has pointers/ideas on how to do this I would be happy to attempt looking into it.

wishlist: Camshift

By no means an issue with this fine library, just a humble plea: Support for Camshift would be super awesome! It's the perfect companion for the cascade classifier: https://gist.github.com/231696

Anyways, thanks for this fantastic effort, I had quite some fun with it already. Keep up the good work!

Install giving error!!

Hello,

I am trying to install this guy on my Ubuntu 13 and I am having some problems. I finally managed to get opencv installed (I am new to Linux), but node-opencv will not install correctly. I am using the "npm install opencv" method and I keep receiving linker errors. Finally, the install fails with:

CXX(target) Release/obj.target/opencv/src/FaceRecognizer.o
../src/FaceRecognizer.cc: In static member function ‘static v8::Handlev8::Value FaceRecognizerWrap::UpdateSync(const v8::Arguments&)’:
../src/FaceRecognizer.cc:218:14: error: ‘class cv::FaceRecognizer’ has no member named ‘update’
make: *** [Release/obj.target/opencv/src/FaceRecognizer.o] Error 1
make: Leaving directory /home/sander/node_modules/opencv/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
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 Linux 3.8.0-25-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "clean" "rebuild"
gyp ERR! cwd /home/sander/node_modules/opencv
gyp ERR! node -v v0.10.12
gyp ERR! node-gyp -v v0.10.0
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

Any input would be great! I am using this with AR-Drone and would love some help.

Thanks,

Sander

[URGENT] Unable to install node-opencv on my ubuntu live server

HI There,

After working with node-opencv on my mac and completed feature validation and when i try to deploy on my live ubuntu box which powers my website www.thply.com its throwing me following error. due to this my website is down for past two days please help.

module.js:356
Module._extensions[extension](this, filename);
^
Error: libopencv_contrib.so.2.4: cannot open shared object file: No such file or directory
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/bala/thply/node_modules/opencv/lib/bindings.js:1:80)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
error: Forever detected script exited with code: 8
error: Forever restarting script for 1 time

module.js:356
Module._extensions[extension](this, filename);
^
Error: libopencv_contrib.so.2.4: cannot open shared object file: No such file or directory
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/bala/thply/node_modules/opencv/lib/bindings.js:1:80)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
error: Forever detected script exited with code: 8
pkg-config --cflags opencv^Cbala@li253-244:/thply$ pkg-config --cflags opencv
-I/usr/local/include/opencv -I/usr/local/include
bala@li253-244:
/thply$

bala@li253-244:~/thply$ sudo locate libopencv_contrib.so.2.4
/home/bala/opencv-2.4.2/OpenCV-2.4.2/build/lib/libopencv_contrib.so.2.4
/home/bala/opencv-2.4.2/OpenCV-2.4.2/build/lib/libopencv_contrib.so.2.4.2
/home/bala/opencv-2.4.5/build/lib/libopencv_contrib.so.2.4
/home/bala/opencv-2.4.5/build/lib/libopencv_contrib.so.2.4.5
/home/bala/opencv-2.4.5/release/lib/libopencv_contrib.so.2.4
/home/bala/opencv-2.4.5/release/lib/libopencv_contrib.so.2.4.5
/home/bala/opencv-x/OpenCV-2.4.2/release/lib/libopencv_contrib.so.2.4
/home/bala/opencv-x/OpenCV-2.4.2/release/lib/libopencv_contrib.so.2.4.2
/usr/local/lib/libopencv_contrib.so.2.4
/usr/local/lib/libopencv_contrib.so.2.4.5

Thank you,
-bala.

Smoke test blowing up

Getting:

OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /opt/local/var/macports/build/_Volumes_work_mports_dports_graphics_opencv/opencv/work/OpenCV-2.4.1/modules/core/src/array.cpp, line 2482
terminate called throwing an exception./smoke.sh: line 6: 47068 Abort trap: 6 node smoketest.js

im.detectObject(cv.FACE_CASCADE, {}, function(err, faces) can return empty array

Seems like the detectObject can return [] instead of undefined ?
where can i find detailed docs for such cases ?
I'm new to node-opencv as well as opencw itself.

anyway:
Means the sample take-faces-pics fails with
opencv/examples/take-face-pics.js:18
-face.y
^
TypeError: Cannot read property 'y' of undefined

Buggy sample ?
Buggy code ?

I'm using 2.4.6 version of openvc

Very large and small data in camera captured image

var cv = require('opencv');
var camera = new cv.VideoCapture(0);

function draw(im){
    var W = im.width();
    var H = im.height();
    for ( var i = 0; i < W; i++){
        var cols = im.col(i);
        for( var j = 0; j < H; j++){
            console.log(cols[j]);
        }
    }
}

camera.read(function(im) {
    im.resize(64,48);
    im.convertGrayscale();
    draw(im);
});

I have the above code. When I do im.save(path), the image is displayed right. However, the values are too large and small. What do they indicate?

(some of them)
-3.5377252865621647e+245
-5.396509253312083e+240
-4.1184862042816195e+216
-7.262811704469595e+182
-6.928236671275438e+182
-2.866246431648803e+163
-9.546116238299925e+148
-1.3091442618706278e+144
-3.95850822459047e+129
-8.401798474215774e+119
-3.896726552698808e+100
-2.111028361401663e+81
-3.9732423848103083e+71
2.340779723395346e-267
0
4.315088729e-314
0
7.10972105e-316
1.24e-322
3.07689389695e-312

Symbol not found: __ZTIN2cv9ExceptionE [gyp branch]

When building with gyp:

-- Compiled OK --

module.js:480
process.dlopen(filename, module.exports);
^
Error: dlopen(/Users/pbraden/Desktop/repos/node-opencv/build/Release/opencv.node, 1): Symbol not found: __ZTIN2cv9ExceptionE
Referenced from: /Users/pbraden/Desktop/repos/node-opencv/build/Release/opencv.node
Expected in: dynamic lookup

at Object.Module._extensions..node (module.js:480:11)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/Users/pbraden/Desktop/repos/node-opencv/lib/bindings.js:1:80)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

Potentially a similar issue to:

https://groups.google.com/forum/?fromgroups#!topic/nodejs/_YGLMA8dr2g

cant find module error

Hi There,

Im getting following error while trying to run Face.js example after installing the module using ' npm install opencv'

module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module '../build/Release/opencv.node'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object. (/home/bala/Desktop/node-opencv/peterbraden-node-opencv-f855b2a/lib/bindings.js:1:80)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)

Any suggestions on what could be causing the error? appreciate your help very much.

Thank you,
bala.

Resolve get/set values

Need to detect type of matrix and act correctly. If the matrix is a FC3 then slice and dice the values together into a javascript integer.

build repo 'node-gyp rebuild' error

I'm using..

Lion osX 10.7.5
OpenCV 2.4.2
Node 10.2

I installed opencv using mac ports.. not sure if this is the problem or not. When I go to build the repo I get the following :

Screen Shot 2013-04-11 at 2 45 54 PM

Is it possible to limit the VideoStream frame rate?

I've got an application where I want to have a relatively low framerate. The reason for this is that I have a video stream being supplied by a camera attached to a robot. The robot core uses a Raspberry Pi and is using node-opencv to process the data which is then served to the client.

The issue I have it that an RPI is an incredibly lightweight system and processing the video is consuming 98% of CPU cycles. I have this code doing the very basic processing:

video_stream.on('data', function(matrix){
    var curtime = Date.now();
     if (curtime > (last_frame + capture_fps)) {
          matrix.convertGrayscale();
          matrix.pyrDown();
          video_buffer = matrix.toBuffer();
          last_frame = curtime;
      }                                                                   
});  

So theoretically I'm limiting the processing of the video to whatever my framerate is (1s in this case) so I'm using less processing there when I need to do the work to resize it, greyscale it and then put it into a buffer for sending. So that's ace.

But what appears to be the case is that because the video stream is in fact a stream, the "data" event is firing at about 20fps which appears to be maxing the CPU as it attempts to process all those frames, even though I'm essentially discarding them.

So why don't I run at full tilt?

Because I need to transmit all that data and also because the video stream is flooding the CPU there's appreciable lag (1-2 seconds min) in the stream and also the robot needs to do other things, when the robot starts working then you notice the lag goes up to 3-4 seconds.

So ideally I'd just like to drop the originating frame rate to about 3fps which is plenty enough for a slow moving robot to go with.

Any thoughts?

Implement copyTo: copy an image onto a part of another

Hi,

I carefully looked through src/Matrix.cc but didn't find a method to copy an image onto a part (ROI) of another image. It would be very good if you implemented this in node-opencv, this would make node-opencv almost a full-featured graphic library.

Implementation of it is discussed here:
http://stackoverflow.com/questions/10481411/opencv-copy-an-cvmat-inside-a-roi-of-another

OpenCV 2.4:
src.copyTo(dst(Rect(left, top, src.cols, src.rows));

OpenCV 2.x:
Mat dst_roi = dst(Rect(left, top, src.cols, src.rows);
src.copyTo(dst_roi);

Windows install error

Hi - I'm getting this error on install...any ideas? thanks!

C:\Users\rtalaman\AppData\Roaming\npm\node_modules\opencv>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" clean rebuild
Package 'opencv' has no Name: field
gyp: Call to 'pkg-config --cflags "opencv >= 2.3.1"' returned exit status 1. while trying to load binding.gyp
gypnpm ERR! [email protected] preinstall: node-gyp clean rebuild
npm ERR! cmd "/c" "node-gyp clean rebuild" failed with 1

Way to creat new haarcascade from image

Hi everybody. I am new to OpenCV and like to creat a new haarcascade from some images for image recognition . Is there an simple way implanted in node-opencv or any bashscript to creat such files?
Would be great if anybody could help me with some information.

greets
Daniel

npm WARN package.json [email protected] No repository field.

$ sudo npm update:

npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv
...

$ pkg-config --cflags opencv:

-I/usr/include/opencv  

$ dpkg --status libopencv-dev | grep 'Status':

Status: install ok installed

$ lsb_release -a

LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: LinuxMint
Description:    Linux Mint 14 Nadia
Release:    14
Codename:   nadia

$ npm -v:

1.2.23

Clustered Face detection - passing frames to workers...

Hi There,

I have a clustered app which is extracting video frames in the master by:

var vid = im.toBuffer().toString('base64');

and then sending them onto a child thread with:

cluster.workers[msg.processId].send(vid);

I am trying to run face detection using:

var analyseVideo = function(imIn) {
var newImage = new canvas.Image();
newImage.src = "data:image/png;base64," + imIn;

//analyse
cv.readImage(newImage, function(err, im) {
    im.detectObject(cv.FACE_CASCADE, {}, function(err, faces) {
                 //do stuff...
            });
    })

}

However, this throws an unsupported type array...

So,

What would be a correct strategy to pass the image across to the sub process and then load it into cv?

Many thanks for your help!

Async Matrix.toBuffer()

I can grab 48233 camera frames per second but when I add a toBuffer() into the mix that number drops to 27. This is still fine for streaming video but if toBuffer was asynchronous it would probably be pretty high - is it possible to put the memcopy out into an async task using libuv?

libpng warning: Image width is zero in IHDR

So... After finally getting opencv 'working' in node I get this error when trying to read from a camera input.

libpng warning: Image width is zero in IHDR
libpng warning: Image height is zero in IHDR
libpng error: Invalid IHDR data

I'm running :
os - 10.8
node - 0.10.18
node-gyp - 0.10.10
opencv - 2.4.6.1

Is there a way of setting a default width and height value in the compile time of the c bindings if in the case width and height are set to zero?

Can't install OpenCV 2.3.1 on OS X 10.8.3. I couldn't identify the problem. Will later OpenCV work with node-opencv?

UPDATE: I went ahead and installed OpenCV 2.4.5 and tried to install node-opencv. I got the following

npm http GET https://registry.npmjs.org/opencv
npm http 200 https://registry.npmjs.org/opencv
npm http GET https://registry.npmjs.org/opencv/-/opencv-0.1.0.tgz
npm http 200 https://registry.npmjs.org/opencv/-/opencv-0.1.0.tgz
npm WARN package.json [email protected] No repository field.

> [email protected] preinstall /Users/madhu/node_modules/opencv
> node-gyp clean rebuild

gyp http GET http://nodejs.org/dist/v0.10.9/node-v0.10.9.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.9/node-v0.10.9.tar.gz
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:415: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.3.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/madhu/node_modules/opencv
gyp ERR! node -v v0.10.9
gyp ERR! node-gyp -v v0.9.6
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Compilation and installation on Heroku

Hello,
as finally I was able to run successfully on Heroku, I want to share in case someone else is interested (of if someone has a straight forward way of doing it).

In effect, due to some limitation of heroku build system, it is not possible to use the standard buildpack and npm.
This step is the one creating the problem <!@(pkg-config --libs opencv).

Despite having the library installed, at build time there is not a way to tell to the node buildpack the location of the configuration file (same for CXX flag).

So, I created a dedicated buildpack for your library, which I could test and validate. (note: this buildpack is not existing anymore, I just leave a gist for reference)

I do not know if you have a suggestion to avoid this hack and have a straight compilation?

thanks

fail to find opencv.pc

I hope this is something stupid but I can't figure out why when installing the build process can't find opencv.pc eventhough the PKG_CONFIG_PATH is set correctly.

Roys-MacBook-Pro:rtc roy$ export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig/
Roys-MacBook-Pro:rtc roy$ echo $PKG_CONFIG_PATH
/opt/local/lib/pkgconfig/
Roys-MacBook-Pro:rtc roy$ sudo npm install opencv
Password:
npm http GET https://registry.npmjs.org/opencv
npm http 304 https://registry.npmjs.org/opencv

[email protected] preinstall /Users/roy/Projects/rtc/node_modules/opencv
node-gyp rebuild

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
Traceback (most recent call last):
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/gyp", line 18, in
sys.exit(gyp.main(sys.argv[1:]))
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/init.py", line 511, in main
return gyp_main(args)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/init.py", line 494, in gyp_main
options.circular_check)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/init.py", line 133, in Load
depth, generator_input_info, check, circular_check)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 2378, in Load
depth, check)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 384, in LoadTargetBuildFile
build_file_data, PHASE_EARLY, variables, build_file_path)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 1053, in ProcessVariablesAndConditionsInDict
build_file)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 1068, in ProcessVariablesAndConditionsInList
ProcessVariablesAndConditionsInDict(item, phase, variables, build_file)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 1027, in ProcessVariablesAndConditionsInDict
ProcessConditionsInDict(the_dict, phase, variables, build_file)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 904, in ProcessConditionsInDict
variables, build_file)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 1046, in ProcessVariablesAndConditionsInDict
build_file, key)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 1053, in ProcessVariablesAndConditionsInDict
build_file)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 1072, in ProcessVariablesAndConditionsInList
expanded = ExpandVariables(item, phase, variables, build_file)
File "/Users/roy/.node-gyp/0.9.2/tools/gyp/pylib/gyp/input.py", line 714, in ExpandVariables
(contents, p.returncode))
Exception: Call to 'pkg-config --cflags opencv' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error

How do get() and set() work?

Maybe this is just a documentation thing.

image.get(10,10) returns extremely high and low values like 3.7870391948821026e+208 or 8.649182377228314e-217 I thought there would be something like FF0000 for red or something.

image.set(10,10,100) does not set a single pixel but a wider region. How does this work exactly?

Error installing opencv

Hi, I get this error when I try to install: npm install opencv

In file included from ../src/CascadeClassifierWrap.h:1:0,
                 from ../src/CascadeClassifierWrap.cc:1:
../src/OpenCV.h:9:16: error fatal: cv.h: No such file or directory
compilación terminada.
In file included from ../src/OpenCV.cc:1:0:
../src/OpenCV.h:9:16: error fatal: cv.h: No such file or directory
compilación terminada.
In file included from ../src/Matrix.h:1:0,
                 from ../src/Matrix.cc:1:
../src/OpenCV.h:9:16: error fatal: cv.h: No such file or directory
compilación terminada.
In file included from ../src/init.cc:1:0:
../src/OpenCV.h:9:16: error fatal: cv.h: No such file or directory
compilación terminada.
Waf: Leaving directory `/var/www/node_modules/opencv/build'

Any ideas about it?

Thanks,
Pablo

opencv

  1. I want a small program to initialize the web cam in video mode. The camera.js program only takes single pictures of it. I want to just initialize the webcam and then record video.
  2. In the second phase I want to transmit the video through node. I have seen the parallax program . But , could not get anything out of it.

Is it possible to get a list of functions presently supported by node opencv?
How can I include more functions , so that it is helpful to all of us

Matrix constructor width/height reversed.

Documentation defines this.

new Matrix(width, height)

In my tests, this was incorrect. The width and height are reversed. I came across this in the Contours.js demo while using a rectangle image.

new Matrix(height, width)

Judging by how width is commonly before height in most applications, the code to handle this input is reversed?

cv.trackedobject guidance

Hi there,

Could you point me to some guidance around trackedobject please? I have it up and running on a raspberry pi - but the box0,1,2,3 co-ords that are returned are always very big (even in a completely static room)...

Many thanks in advance...

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.