Ask Your Question
0

how can provide legacy support for face recognition

asked 2018-07-09 04:19:03 -0500

kishan patel gravatar image

Hello, Actually, i have using opencv 3.1 version. When i have tried to compile application by using command like as "g++ -std=c++11 OnlineFaceRec.cpp -I/usr/include/opencv -I/usr/include/opencv2 -L/usr/lib -o facerecognition pkg-config --cflags --libs opencv", i got some errors as below:

OnlineFaceRec.cpp:221:31: error: 'cvCopyImage' was not declared in this scope cvCopyImage(byteImg, bigImg); ^ OnlineFaceRec.cpp: In function 'void learn(const char*)': OnlineFaceRec.cpp:265:45: error: 'cvEigenDecomposite' was not declared in this scope } ^ OnlineFaceRec.cpp: In function 'void doPCA()': OnlineFaceRec.cpp:443:3: error: 'CV_EIGOBJ_NO_CALLBACK' was not declared in this scope

^~~
OnlineFaceRec.cpp:448:23: error: 'cvCalcEigenObjects' was not declared in this scope

                   ^

OnlineFaceRec.cpp: In function 'void recognizeFileList(const char*)': OnlineFaceRec.cpp:563:21: error: 'cvEigenDecomposite' was not declared in this scope

                 ^

OnlineFaceRec.cpp: In function 'void recognizeFromCam()': OnlineFaceRec.cpp:846:23: error: 'FALSE' was not declared in this scope

                   ^~~~

OnlineFaceRec.cpp:939:22: error: 'TRUE' was not declared in this scope } ^
OnlineFaceRec.cpp:1015:23: error: 'cvEigenDecomposite' was not declared in this scope

Now, i have make some changes and reduce errors as below:

I have replaced "cvCopyImage" by "cvCopy" Also replaced "TRUE" by "true" and "FALSE" by "false".

Still i have remaining errors as below:

OnlineFaceRec.cpp:265:45: error: 'cvEigenDecomposite' was not declared in this scope } ^ OnlineFaceRec.cpp: In function 'void doPCA()': OnlineFaceRec.cpp:443:3: error: 'CV_EIGOBJ_NO_CALLBACK' was not declared in this scope

^~~
OnlineFaceRec.cpp:448:23: error: 'cvCalcEigenObjects' was not declared in this scope

                   ^

OnlineFaceRec.cpp: In function 'void recognizeFileList(const char*)': OnlineFaceRec.cpp:563:21: error: 'cvEigenDecomposite' was not declared in this scope

                 ^

OnlineFaceRec.cpp: In function 'void recognizeFromCam()': OnlineFaceRec.cpp:1015:23: error: 'cvEigenDecomposite' was not declared in this scope

Please, provide me some steps to solve this errors. Note that i have using opencv 3.1 version.

Thanks and Regards, Kishan Patel.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-07-09 04:37:12 -0500

berak gravatar image

the short answer is : do NOT use any of this. the c-api was deprecated in 2010, is no more maintained, and will be gone in future releases (so your code is unmaintainable, too !)

also, the c api is hidden from the c++ headers (again, on purpose !) so you would have to use headers like:

#include "opencv2/core_c.h"

but again, DON'T. you're only wasting anyone's time.

edit flag offensive delete link more

Comments

Hello Berak, Thanks for reply. Yes, i had tested it by including "opencv2/core_c.h". But, same error occur. So, what should i do here? Is there any way by which i have not to replace all code?.

kishan patel gravatar imagekishan patel ( 2018-07-09 04:51:30 -0500 )edit

a lot of those functions ('cvEigenDecomposite' ) are simply no more there (were removed with the legacy module in 3.0). give up on it, please.

berak gravatar imageberak ( 2018-07-09 05:04:26 -0500 )edit

Okay Berak, I have searched many sample code for face recognition with opencv 3.1. But i could not find it proper in one file. I can see some codes in python(like as create csv.py then execute cpp file, etc). Can you guide me steps or relevant sample code in c/c++ for face recognition using opencv 3.1 version.

Thanks.

kishan patel gravatar imagekishan patel ( 2018-07-09 06:14:29 -0500 )edit

we had ALL of this already, no ?

again, imho your best bet is to get the code from here and merge that somehow into your project

berak gravatar imageberak ( 2018-07-09 06:25:07 -0500 )edit

Thanks Berak, It will useful for me.If you have some time, can you help me to setup atleast one demo for face recognition using this source code.

Please.

kishan patel gravatar imagekishan patel ( 2018-07-09 07:09:25 -0500 )edit

sorry, but i won't do that. (it also HAS existing samples, just care to look !)

berak gravatar imageberak ( 2018-07-09 07:12:22 -0500 )edit

Hello Berak, Actually, i saw tutorial directory. But it shows output images.

kishan patel gravatar imagekishan patel ( 2018-07-09 07:17:17 -0500 )edit

Hello Berak, Actually, when i have tried to install opencv 3.1 version on ubuntu system. It has install 4.0-pre version. Can you provide me proper link/steps to install opencv 3.1 with contrib module on ubuntu system.

kishan patel gravatar imagekishan patel ( 2018-07-10 01:28:05 -0500 )edit

if you CAN use 4.0 (or anything newer than 3.1), you should use that ! (and try the new dnn based face recognition, which is far easier to use, and better, that the (fairly outdated) classes in contrib)

but again, we've been through ALL of this already.

start using your own head now, and stop repeating the same questions over & over, please.

berak gravatar imageberak ( 2018-07-10 01:36:21 -0500 )edit

Hello Berak, I had not asked for opencv 3.1 before. I have asked related 2.4 and 3.4 version. Actually, i had tried to install 3.1 many times, but it install 4.0-pre version.

Please, provide me step last time.

kishan patel gravatar imagekishan patel ( 2018-07-10 02:30:05 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-07-09 04:19:03 -0500

Seen: 133 times

Last updated: Jul 09 '18