Giter Site home page Giter Site logo

Comments (11)

rhasson avatar rhasson commented on July 18, 2024

So I managed to get it to build but I'm not sure how...

Now I'm seeing the following:

c = require('opencv')
Error: Cannot find module 'opencv'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at repl:1:6
at REPLServer.self.eval (repl.js:112:21)
at Interface. (repl.js:250:12)
at Interface.EventEmitter.emit (events.js:88:17)
at Interface._onLine (readline.js:199:10)
at Interface._line (readline.js:519:8)

I tried the suggestion in a previous issue to run ./build.sh but that still didn't fix the issue.

Any ideas?

from node-opencv.

rhasson avatar rhasson commented on July 18, 2024

I found out the problem.

init.cc:
NODE_MODULE(binding, init)

but needs to be:
NODE_MODULE(opencv, init)

I made the change, rebuilt and it loads up fine.

b = require('./lib/bindings.js')
{ version: '2.4',
readImage: [Function],
Point: [Function: Point],
Matrix: { [Function: Matrix] Eye: [Function] },
CascadeClassifier: [Function: CascadeClassifier],
VideoCapture: [Function: VideoCapture],
Contours: [Function: Contours] }
c = require('./lib/opencv.js')
{ ImageStream:
{ [Function]
super_:
{ [Function: Stream]
super_: [Function: EventEmitter],
Stream: [Circular] } } }

from node-opencv.

peterbraden avatar peterbraden commented on July 18, 2024

Interesting - nice. What platform are you on because I've never seen this? Can you make this a pull request so I can run the travis tests agains it?

Thanks!

from node-opencv.

rhasson avatar rhasson commented on July 18, 2024

I'm on OSX 10.8.2

I'm making a pull request now.

from node-opencv.

peterbraden avatar peterbraden commented on July 18, 2024

closed by #18

from node-opencv.

RaphiePS avatar RaphiePS commented on July 18, 2024

I'm on OSX 10.8.2 and I'm still having this issue. Could it be due to my opencv version? I have v2.4.2 installed via Homebrew.

from node-opencv.

peterbraden avatar peterbraden commented on July 18, 2024

wait, I hadn't republished on npm yet - try again now.

from node-opencv.

RaphiePS avatar RaphiePS commented on July 18, 2024

Huh, still not working. This is the error message if that's any help: https://gist.github.com/2327c58034aa01572275.

from node-opencv.

rhasson avatar rhasson commented on July 18, 2024

You're seeing an error with building node-opencv, the fix that I peterbraden provided was for loading the module into node after you successfully built it.

Did you try to set your PKG_CONFIG_PATH environment variable to point to the opencv pkgconfig directory (with macports it's /opt/local/lib/pkgconfig/, not sure what it is for homebrew installs) ? I installed opencv 2.4.2 with macports and had to manually set this environment variable since the installation path was not the default one.

from node-opencv.

RaphiePS avatar RaphiePS commented on July 18, 2024

Bingo! Thanks!

from node-opencv.

mustafaakin avatar mustafaakin commented on July 18, 2024

For Ubuntu users that have this problem, just install libopencv-dev package too.

from node-opencv.

Related Issues (20)

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.