Question

I want to test Flandmarks for face detection http://cmp.felk.cvut.cz/~uricamic/flandmark/ But I cant get it to work.

I've been working on this for probably 10 hours. I asked for help on opencv.org (http://answers.opencv.org/question/16956/eye-detection-is-jumping/ , the question were first about something else, see comments if you want to read what was said about this problem) And got some help but the problem is still there.

Computer: 64bit, windows 7, Visual studio 2010.

What I've tried:

Due to this problem i was asked to try with an empty project so I did that.

I started an empty project in visual studio c++ 2010. Property manager-> Added under C/C++ -> Additional include directories:

* C:\Program Files (x86)\opencv\build\include
* C:\Program Files (x86)\opencv\build\include\opencv
* C:\Program Files (x86)\opencv\build\include\opencv2

Property manager-> LInker -> Additional include directories ->

* C:\Program Files (x86)\opencv\build\x64\vc10\lib;
* C:\Program Files (x86)\opencv\build\x64\vc10\bin; 
* %(AdditionalLibraryDirectories)

Property Manager -> Linker -> Input -> Additional dependencies ->

* opencv_calib3d244d.lib
* opencv_contrib244d.lib
* opencv_core244d.lib
* opencv_features2d244d.lib
* opencv_flann244d.lib
* opencv_gpu244d.lib
* opencv_haartraining_engined.lib
* opencv_highgui244d.lib
* opencv_imgproc244d.lib
* opencv_legacy244d.lib
* opencv_ml244d.lib
* opencv_nonfree244d.lib
* opencv_objdetect244d.lib
* opencv_photo244d.lib
* opencv_stitching244d.lib
* opencv_ts244d.lib
* opencv_video244d.lib
* opencv_videostab244d.lib

Property manager -> COnfiguration manager -> ACtive Solution platform ->

  • Changed from win32 to "new", where I changed from Itanium To x64. Copy settings from "win32"

From the zip-file that you can download at flandmarks homepage, I copy the files in the folder "libflandmark". to my project folder. And I also copy the dat-file to the project folder.

* flandmark_detector.cpp
* flandmark_detector.h
* liblbp.cpp
* liblbp.h
* msvc-compat.h
* flandmark_model.dat

I created a main.cpp where I added:

#include "stdio.h"
#include "flandmark_detector.h"


int main(int argc, char * argv[]) 
{ 
    printf("test");
    FLANDMARK_Model * model = flandmark_init("flandmark_model.dat");

    return 0;
}

After this the error is:

1>  All outputs are up-to-date.
1>main.obj : error LNK2019: unresolved external symbol "struct model_struct * __cdecl flandmark_init(char const *)" (?flandmark_init@@YAPEAUmodel_struct@@PEBD@Z) referenced in function main
1>C:\projects\test_projects\flandmarks_empty\x64\Debug\flandmarks_empty.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.47
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks for reading!

Était-ce utile?

La solution

The compiler is looking for flandmart_init(char const *). You need to include the header file that defined this function. If you have already included its header file then the compiler cannot find where the function flandmart_init() was defined. Now if you have flandmark_detector.cpp and flandmark_model.cpp as this looks like a third party code. Include both their header files and after that include on your project flandmark_model.cpp and flandmark_model.cpp, whichever defined the function flandmart_init(char const *). Make sure it compiles. Add them together with your .cpp files. You can right click the Source Files on your project, then click; Add->Existing Item.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top