c++ - Error while trying to build stasm minimal -
i not have experience on c++. , have use stasm face detection. i'm traying build minimal example. on page 4 of tutorial possible know necessary make work. i'm these 2 errors:
g++ -wno-deprecated -o teste minimal.cpp `pkg-config opencv --cflags --libs` -i/home/caaarlos/workspace/stasmdesbravando/stasm in file included minimal.cpp:46:0: /home/caaarlos/documentos/tcc/stasm4.1.0/stasm/pinstart.cpp: in function ‘void stasm::copypoint(stasm::shape&, const shape&, int, int)’: /home/caaarlos/documentos/tcc/stasm4.1.0/stasm/pinstart.cpp:138:13: error: redefinition of ‘void stasm::copypoint(stasm::shape&, const shape&, int, int)’ static void copypoint( // copy point oldshape shape ^ in file included minimal.cpp:37:0: /home/caaarlos/documentos/tcc/stasm4.1.0/stasm/convshape.cpp:9:13: error: ‘void stasm::copypoint(stasm::shape&, const shape&, int, int)’ defined here static void copypoint( // copy point oldshape shape
this code:
// minimal.cpp: display landmarks of face in image. // demonstrates stasm_search_single. #include <stdio.h> #include <stdlib.h> #include "opencv/highgui.h" #include <opencv/cv.h> //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm_lib.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/asm.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/atface.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/basedesc.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/classicdesc.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/convshape.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/err.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/eyedet.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/eyedist.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/faceroi.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/hat.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/hatdesc.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/landmarks.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/landtab_muct77.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/misc.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/pinstart.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/print.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/shape17.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/shapehacks.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/shapemod.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/startshape.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm_landmarks.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm_lib.h" //#include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm_lib_ext.h" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/asm.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/classicdesc.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/convshape.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/err.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/eyedet.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/eyedist.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/faceroi.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/hat.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/hatdesc.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/landmarks.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/misc.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/pinstart.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/print.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/shape17.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/shapehacks.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/shapemod.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/startshape.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/stasm_lib.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/mod_1/facedet.h" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/mod_1/initasm.h" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/mod_1/initasm.cpp" #include "/home/caaarlos/documentos/tcc/stasm4.1.0/stasm/mod_1/facedet.cpp" using namespace cv; using namespace std; int main() { static const char* const path = "../data/testface.jpg"; cv::mat_<unsigned char> img(cv::imread(path, cv_load_image_grayscale)); if (!img.data) { printf("cannot load %s\n", path); exit(1); } int foundface; float landmarks[2 * stasm_nlandmarks]; // x,y coords (note 2) if (!stasm_search_single(&foundface, landmarks, (const char*)img.data, img.cols, img.rows, path, "../data")) { printf("error in stasm_search_single: %s\n", stasm_lasterr()); exit(1); } if (!foundface) printf("no face found in %s\n", path); else { // draw landmarks on image white dots (image monochrome) stasm_force_points_into_image(landmarks, img.cols, img.rows); (int = 0; < stasm_nlandmarks; i++) img(cvround(landmarks[i*2+1]), cvround(landmarks[i*2])) = 255; } cv::imwrite("minimal.bmp", img); cv::imshow("stasm minimal", img); cv::waitkey(); return 0; }
i'm compiling code in thi way:
g++ -wno-deprecated -o teste minimal.cpp `pkg-config opencv --cflags --libs` -i/home/caaarlos/workspace/stasmdesbravando/stasm
what doing wrong? can me? thanks.
i've found solution problem. if has problem mine, should enter on this site , use cmakelist.txt , cmake build stasm. if error can try intructions provides o readme.
Comments
Post a Comment