node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

Install error regarding members in FaceRecognizer.o

Open kriston13 opened this issue 8 years ago • 3 comments

Hi All,

running mac: 10.12.6 node: v8.4.0 npm: v5.4.0 opencv: v3.3.0

running npm install opencv goes into the build process (cause the amazon link is still dead), and it fails on attempting to compile FaceRecognizer.o with the following set of errors:

  CXX(target) Release/obj.target/opencv/src/FaceRecognizer.o
../src/FaceRecognizer.cc:11:19: error: no member named 'createEigenFaceRecognizer' in namespace 'cv::face'; did you mean
      'EigenFaceRecognizer'?
  using cv::face::createEigenFaceRecognizer;
        ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
                  EigenFaceRecognizer
/usr/local/Cellar/opencv/3.3.0_3/include/opencv2/face/facerec.hpp:54:20: note: 'EigenFaceRecognizer' declared here
class CV_EXPORTS_W EigenFaceRecognizer : public BasicFaceRecognizer
                   ^
../src/FaceRecognizer.cc:12:19: error: no member named 'createFisherFaceRecognizer' in namespace 'cv::face'; did you
      mean 'FisherFaceRecognizer'?
  using cv::face::createFisherFaceRecognizer;
        ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
                  FisherFaceRecognizer
/usr/local/Cellar/opencv/3.3.0_3/include/opencv2/face/facerec.hpp:89:20: note: 'FisherFaceRecognizer' declared here
class CV_EXPORTS_W FisherFaceRecognizer : public BasicFaceRecognizer
                   ^
../src/FaceRecognizer.cc:13:19: error: no member named 'createLBPHFaceRecognizer' in namespace 'cv::face'; did you mean
      'LBPHFaceRecognizer'?
  using cv::face::createLBPHFaceRecognizer;
        ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
                  LBPHFaceRecognizer
/usr/local/Cellar/opencv/3.3.0_3/include/opencv2/face/facerec.hpp:126:20: note: 'LBPHFaceRecognizer' declared here
class CV_EXPORTS_W LBPHFaceRecognizer : public FaceRecognizer
                   ^
../src/FaceRecognizer.cc:71:39: error: no member named 'createLBPHFaceRecognizer' in namespace 'cv'
  cv::Ptr<cv::FaceRecognizer> f = cv::createLBPHFaceRecognizer(1, 8, 8, 8, 80.0);
                                  ~~~~^
../src/FaceRecognizer.cc:93:79: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
  Local<Object> n = Nan::New(FaceRecognizerWrap::constructor)->GetFunction()->NewInstance();
                                                                              ^
/Users/jonathantan/.node-gyp/8.4.0/include/node/v8.h:3792:52: note: 'NewInstance' has been explicitly marked deprecated
      here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
../src/FaceRecognizer.cc:94:39: error: no member named 'createLBPHFaceRecognizer' in namespace 'cv'
  cv::Ptr<cv::FaceRecognizer> f = cv::createLBPHFaceRecognizer(radius,
                                  ~~~~^
../src/FaceRecognizer.cc:111:79: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
  Local<Object> n = Nan::New(FaceRecognizerWrap::constructor)->GetFunction()->NewInstance();
                                                                              ^
/Users/jonathantan/.node-gyp/8.4.0/include/node/v8.h:3792:52: note: 'NewInstance' has been explicitly marked deprecated
      here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
../src/FaceRecognizer.cc:112:39: error: no member named 'createEigenFaceRecognizer' in namespace 'cv'
  cv::Ptr<cv::FaceRecognizer> f = cv::createEigenFaceRecognizer(components,
                                  ~~~~^
../src/FaceRecognizer.cc:129:79: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
  Local<Object> n = Nan::New(FaceRecognizerWrap::constructor)->GetFunction()->NewInstance();
                                                                              ^
/Users/jonathantan/.node-gyp/8.4.0/include/node/v8.h:3792:52: note: 'NewInstance' has been explicitly marked deprecated
      here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
../src/FaceRecognizer.cc:131:39: error: no member named 'createFisherFaceRecognizer' in namespace 'cv'
  cv::Ptr<cv::FaceRecognizer> f = cv::createFisherFaceRecognizer(components,
                                  ~~~~^
../src/FaceRecognizer.cc:391:14: error: no matching member function for call to 'load'
  self->rec->load(filename);
  ~~~~~~~~~~~^~~~
/usr/local/Cellar/opencv/3.3.0_3/include/opencv2/core.hpp:3082:44: note: candidate template ignored: couldn't infer
      template argument '_Tp'
    template<typename _Tp> static Ptr<_Tp> load(const String& filename, const String& objname=String())
                                           ^
../src/FaceRecognizer.cc:423:68: warning: 'NewInstance' is deprecated [-Wdeprecated-declarations]
  Local<Object> im = Nan::New(Matrix::constructor)->GetFunction()->NewInstance();
                                                                   ^
/Users/jonathantan/.node-gyp/8.4.0/include/node/v8.h:3792:52: note: 'NewInstance' has been explicitly marked deprecated
      here
  V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                   ^
4 warnings and 8 errors generated.

It then proceeds to fail with an exit code of 2.

There are also other deprecation warnings, but this is the first set of errors...

Does anybody have any idea what's happening...? And how to fix it? Thanks!

kriston13 avatar Sep 05 '17 04:09 kriston13

I encountered the same error and was able to at least npm install opencv after switching back to opencv 2.4.13. To do that I did (unfortunately a bad idea if you want opencv 3.3.0 installed for other purposes)

brew remove opencv
brew install opencv@2
brew link opencv@2 --force

jcreedcmu avatar Sep 18 '17 21:09 jcreedcmu

the api has changed: cv::face::createEigenFaceRecognizer is now cv::face::EigenFaceRecognizer::create(). the same goes for all face recognizers. and, also, I had another problem right after this one: faceRecognier->load is now faceRecognier->read.

VirgileD avatar Sep 26 '17 13:09 VirgileD

This is correct, it worked for me! as VirgileD suggested it should be cv::face::EigenFaceRecognizer::create()

AbdulrahmanHajeKarim avatar Apr 24 '18 14:04 AbdulrahmanHajeKarim