Ask Your Question
0

OpenCV compile Eigenface.cpp in Linux with using CodeBlocks

asked 2013-04-12 06:11:03 -0600

Adrianos01 gravatar image

updated 2013-04-12 06:14:51 -0600

I want to compile the following OpenCV programm with CodeBlocks or with Linux Terminal.

http://plaza.ufl.edu/tyler727/imdl/src/eigenface.cpp

line 57:   nTrainFaces = loadFaceImgArray("/home/hacker/data/Eigenfacecpp/train.txt");

line 192: // load test images and ground truth for person number
         nTestFaces = loadFaceImgArray("/home/hacker/data/Eigenfacecpp/test.txt");

// project the training images onto the PCA subspace
projectedTrainFaceMat = cvCreateMat(nTrainFaces, nEigens, > CV_32FC1);

for(i=0; i<nTrainFaces; i++)
{
    cvEigenDecomposite(faceImgArr[i],
                       nEigens,
                       eigenVectArr,
                       0, 0,
                       pAvgTrainImg,

line 78: projectedTrainFaceMat->data.fl + i*nEigens); }

 cvCalcEigenObjects(nTrainFaces,
                    (void*)faceImgArr,
                    (void*)eigenVectArr,
                    CV_EIGOBJ_NO_CALLBACK,
                    0,
                    0,
                    &calcLimit,
                    pAvgTrainImg,

line 154: eigenValMat->data.fl);

    //project the test image onto the PCA subspace
    cvEigenDecomposite(faceImgArr[i],
                       nEigens,
                       eigenVectArr,
                       0, 0,
                       pAvgTrainImg, line 211:               
                       projectedTestFace);

And i got those errors:

Compiling: eigenface.cpp

In Function »void learn()«: line 57: deprecated conversion from string constant to ‘char*’ [Wwrite-strings]

In Function »double recognize()«: line 192: deprecated conversion from string constant to ‘char*’ [Wwrite-strings]

/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function _start': (.text+0x18): undefined reference tomain' obj/Debug/eigenface.o: In function learn()': /home/hacker/data/Eigenfacecpp/eigenface.cpp:78: undefined reference tocvEigenDecomposite'

obj/Debug/eigenface.o: In function doPCA()': /home/hacker/data/Eigenfacecpp/eigenface.cpp:154: undefined reference tocvCalcEigenObjects'

obj/Debug/eigenface.o: In function recognize()': /home/hacker/data/Eigenfacecpp/eigenface.cpp:211: undefined reference tocvEigenDecomposite' I don't understand what I did wrong. I think it's something stupid but I can't find it.

Compiler and Debugger Settings from CodeBlocks:

Linker Settings->Other Options: -lopencv_core -lopencv_objdetect -lopencv_imgproc -lopencv_highgui

Search Directories->Compiler: /usr/local/include/opencv Search Directories->Linker: /usr/lib

What have I done wrong here? Please help me with this problem.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2013-04-12 06:25:02 -0600

berak gravatar image

cvEigenDecomposite was moved to legacy/legacy.hpp

if you want my 2 ct.:

discard that code ( stoneage ), instead look at a more recent facereco impl

note, that later opencv versions also come with a fisher and a lbp based reco, which perform much better than a plain pca.

edit flag offensive delete link more

Comments

+1 for fisherfaces, they get very good recognition rates!

StevenPuttemans gravatar imageStevenPuttemans ( 2013-04-12 06:52:23 -0600 )edit

what does ct. mean?

Adrianos01 gravatar imageAdrianos01 ( 2013-04-12 09:13:50 -0600 )edit
1

my 2 cent, - some cheap (and unwanted) opinion / advice ..

berak gravatar imageberak ( 2013-04-12 09:27:06 -0600 )edit

Question Tools

Stats

Asked: 2013-04-12 06:11:03 -0600

Seen: 875 times

Last updated: Apr 12 '13