07 May 2013

Config of VOSM under Win7-32bit with VS2010 using CMake

VOSM is an open source 2D ASM/AAM C++ implementation which can be downloaded from here. Extract the file to a convenient directory, say .\vosm-0.3.3. If use CMake to compile the project we need to copy .\vosm-0.3.3\doc folder from other repository (say Linux) which contains a licience.txt that is required for CMake. We may need to modify the given CMakeLists.txt since the viriable OPENCV_INCLUDE_PATH was not set correctly. To solve this problem, change these lines (starting from line:248):
find_path(OPENCV_INCLUDE_PATH "cv.h"
        PATHS "/usr/include/opencv" "/usr/local/include/opencv"
        DOC "The path to OPENCV headers")
to:
 set(OPENCV_INCLUDE_PATH "DIRECTORY/TO/OPENCV/INCLUDE_FOLDER")
Then set both source and build directory in CMake to .\vosm-0.3.3 and Configure and Generate.
In .\vosm-0.3.3, open vosm.sln and Solution Explorer looks like:
For all projects whose names are all capital (such as ALL_BUILD), we don't need to configure them.
For all projects' name not start with (EXAMPLE) (such as smbuilding), change project (debug and release) property Configuration Type to Static library (.lib) and set Output Directory as .\vosm-0.3.3\lib\Debug\ or  .\vosm-0.3.3\lib\Release\. Set Target Extension to .lib. Here is a snapshot of property pages after this step:
For all projects except the one with capital name, configure OpenCV and Boost include and library directory (if they are not there) since they are VOSM's dependent libraries.
For all projects' name start with (EXAMPLE), configure correct OpenCV and Boost .lib file for each for both debug and release. The name of the .lib files are (OpenCV-2.4.4 Boost-1.4.9):
OpenCV Debug:
opencv_core244d.lib
opencv_flann244d.lib
opencv_imgproc244d.lib
opencv_highgui244d.lib
opencv_ml244d.lib
opencv_video244d.lib
opencv_objdetect244d.lib
opencv_features2d244d.lib
opencv_calib3d244d.lib
opencv_legacy244d.lib
opencv_contrib244d.lib
OpenCV Release:
opencv_core244.lib
opencv_flann244.lib
opencv_imgproc244.lib
opencv_highgui244.lib
opencv_ml244.lib
opencv_video244.lib
opencv_objdetect244.lib
opencv_features2d244.lib
opencv_calib3d244.lib
opencv_legacy244.lib
opencv_contrib244.lib
Boost Debug:
libboost_regex-vc100-mt-gd-1_49.lib
libboost_filesystem-vc100-mt-gd-1_49.lib
libboost_system-vc100-mt-gd-1_49.lib
Boost Release:
libboost_regex-vc100-mt-1_49.lib
libboost_filesystem-vc100-mt-1_49.lib
libboost_system-vc100-mt-1_49.lib

Finally, set correct directory for face detection file in smfitting.cpp under (EXAMPLE)test_smfitting project. The snippet is located from line:344 to line:353. Like:
#elif WIN32
    fd.SetConfiguration("C:\\Program Files\\opencv\\opencv\\data\\lbpcascades\\lbpcascade_frontalface.xml", 
        "C:\\Program Files\\opencv\\opencv\\data\\haarcascades\\haarcascade_profileface.xml",
        "C:\\Program Files\\opencv\\opencv\\data\\haarcascades\\haarcascade_mcs_lefteye.xml",
        "C:\\Program Files\\opencv\\opencv\\data\\haarcascades\\haarcascade_mcs_righteye.xml",
        "C:\\Program Files\\opencv\\opencv\\data\\haarcascades\\haarcascade_mcs_nose.xml",
        "C:\\Program Files\\opencv\\opencv\\data\\haarcascades\\haarcascade_mcs_mouth.xml",
        VO_AdditiveStrongerClassifier::BOOSTING,
        CFaceDetectionAlgs::FRONTAL );
#endif 
Compile the ALL_BUILD project will compile all projects in current solution.

No comments:

Post a Comment