Skip to content

Commit

Permalink
- Solved the whole hdf5 mess under windows! Should work in linux as w…
Browse files Browse the repository at this point in the history
…ell, will test later

- Upgrade to VS2013!
- added a test-app for the renderer
  • Loading branch information
patrikhuber committed Dec 26, 2013
1 parent 1f1d328 commit 9bac0ae
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 51 deletions.
31 changes: 16 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,28 @@ add_subdirectory(libCondensation) # Condensation tracking (particle filter)
add_subdirectory(libRender) # A software renderer to render vertices and 3D-meshes
add_subdirectory(libShapeModels) # Head/face specific things; 2D/3D models; Combining feature points

add_subdirectory(benchmarkApp) # Benchmark app for feature extractors and classifiers in a tracking-like online learning scenario.
add_subdirectory(faceTrackingApp) # Face tracking app (no adaptation to target).
add_subdirectory(adaptiveTrackingApp) # Adaptive tracking app.
#add_subdirectory(benchmarkApp) # Benchmark app for feature extractors and classifiers in a tracking-like online learning scenario.
#add_subdirectory(faceTrackingApp) # Face tracking app (no adaptation to target).
#add_subdirectory(adaptiveTrackingApp) # Adaptive tracking app.
#add_subdirectory(partiallyAdaptiveTrackingApp) # Old adaptive tracking app.
add_subdirectory(headTrackingApp) # Adaptive head tracking app.
add_subdirectory(ffpDetectApp) # The classic MR-style face-detect app (4 stages, SvmOeWvmOe).
add_subdirectory(faceDetectApp) # The new, smart face- and facial feature point detection app.
#add_subdirectory(headTrackingApp) # Adaptive head tracking app.
#add_subdirectory(ffpDetectApp) # The classic MR-style face-detect app (4 stages, SvmOeWvmOe).
#add_subdirectory(faceDetectApp) # The new, smart face- and facial feature point detection app.

add_subdirectory(facemodelTracking) # Todo
#add_subdirectory(renderTestApp) # Todo

add_subdirectory(generateSyntheticLandmarkDataKlaus) # An app specifically created for the task of generating synthetic landmark data from random faces from the 3DMM.
add_subdirectory(3dmmRendererGUI) # An interactive GUI for rendering 3D-meshes, and if it's a morphable model, modify the principal components
add_subdirectory(openGlRendererGUI) # Same as above, but with OpenGL rendering. Playground - in the end, will all be merged into one.
#add_subdirectory(generateSyntheticLandmarkDataKlaus) # An app specifically created for the task of generating synthetic landmark data from random faces from the 3DMM.
#add_subdirectory(3dmmRendererGUI) # An interactive GUI for rendering 3D-meshes, and if it's a morphable model, modify the principal components
#add_subdirectory(openGlRendererGUI) # Same as above, but with OpenGL rendering. Playground - in the end, will all be merged into one.

#add_subdirectory(trackerAppERT) # kind of deprecated, was only a test. But can use this to see how to make a real-time tracker.

add_subdirectory(mergePlaygroundApp) # Test-app for the refactored/merged code
#add_subdirectory(mergePlaygroundApp) # Test-app for the refactored/merged code

add_subdirectory(frRunCogExp) # App for doing face recognition tests with a gallery and probe images
add_subdirectory(frDbTool) # App for managing (creating and populating) the sqlite-database used for face-recognition experiments
add_subdirectory(frDbExp) # App for doing experiments with the face recognition scores in the database
#add_subdirectory(frRunCogExp) # App for doing face recognition tests with a gallery and probe images
#add_subdirectory(frDbTool) # App for managing (creating and populating) the sqlite-database used for face-recognition experiments
#add_subdirectory(frDbExp) # App for doing experiments with the face recognition scores in the database

add_subdirectory(ffpDetectAppExp) # Experimental playground for FFD with the 3DMM/POSIT
add_subdirectory(ransacTestApp) # Experimental playground for RANSAC
#add_subdirectory(ffpDetectAppExp) # Experimental playground for FFD with the 3DMM/POSIT
#add_subdirectory(ransacTestApp) # Experimental playground for RANSAC
18 changes: 13 additions & 5 deletions facemodelTracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ FIND_PACKAGE( OpenCV 2.3.1 REQUIRED core imgproc highgui calib3d )
MESSAGE(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}")
MESSAGE(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}")

#Hdf5:
#IF(WIN32)
#FIND_PACKAGE (HDF5 NAMES hdf5) # puts it in Config-mode
FIND_PACKAGE (HDF5 REQUIRED COMPONENTS C CXX NAMES hdf5) # COMPONENTS doesn't seem to work
set (HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR}) # According to hdf5 cmake file, should use *_DIRS, but they don't define it in hdf5-config.cmake. So if we use the Config-mode with NAMES, it isn't set, but it is, when used as in linux.
#FIND_PACKAGE (HDF5 REQUIRED CONFIG) # same
#LX: FIND_PACKAGE (HDF5 REQUIRED COMPONENTS C CXX) # works on windows as well but links to dll's instead of lib's...
#ENDIF()

message(STATUS "HDF5 includes at: ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5 libraries at: ${HDF5_LIBRARIES}")

#Matlab:
SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
FIND_PACKAGE( MATLAB REQUIRED )
Expand Down Expand Up @@ -39,6 +51,7 @@ ADD_EXECUTABLE( ${SUBPROJECT_NAME} ${SOURCE} ${HEADERS} )
INCLUDE_DIRECTORIES( ${MATLAB_INCLUDE_DIR} )
include_directories( ${Boost_INCLUDE_DIRS} )
include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories( ${HDF5_INCLUDE_DIRS} )
include_directories( ${Logging_SOURCE_DIR}/include )
include_directories( ${ImageLogging_SOURCE_DIR}/include )
include_directories( ${ImageIO_SOURCE_DIR}/include )
Expand All @@ -48,10 +61,5 @@ include_directories( ${Render_SOURCE_DIR}/include )
include_directories( ${ShapeModels_SOURCE_DIR}/include )
include_directories( ${Detection_SOURCE_DIR}/include )

# Hdf5 "hack":
INCLUDE_DIRECTORIES("C:\\Users\\Patrik\\Cloud\\PhD\\HDF5\\include\\hdf5\\")
link_directories( "C:\\Users\\Patrik\\Cloud\\PhD\\HDF5\\lib\\hdf5\\" )
set(HDF5_LIBRARIES debug hdf5d debug hdf5_cppd optimized hdf5; optimized hdf5_cpp)

#Make the app depend on the libraries
TARGET_LINK_LIBRARIES( ${SUBPROJECT_NAME} Detection ImageIO ${KINECT_LIBNAME} ImageProcessing Classification ShapeModels Render ImageLogging Logging ${Boost_LIBRARIES} ${MATLAB_MX_LIBRARY} ${MATLAB_MAT_LIBRARY} ${OpenCV_LIBS} ${HDF5_LIBRARIES} )
2 changes: 1 addition & 1 deletion facemodelTracking/facemodelTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ int main(int argc, char *argv[])
//buff.convertTo(buffWithoutAlpha, CV_BGRA2BGR);
cvtColor(buff, buffWithoutAlpha, cv::COLOR_BGRA2BGR);
Mat weighted = img2.clone(); // get the right size
cv::addWeighted(img2, 0.3, buffWithoutAlpha, 0.7, 0.0, weighted);
cv::addWeighted(img2, 0.7, buffWithoutAlpha, 0.3, 0.0, weighted);
//return std::make_pair(translation_vector, rotation_matrix);
img2 = weighted;
}
Expand Down
4 changes: 2 additions & 2 deletions install_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ echo 1) SETUP BUILD:
echo ============================
echo Running:
echo ---
echo cmake -C ..\FeatureDetection\initial_cache.cmake -G "Visual Studio 11 Win64" ..\FeatureDetection
cmake -C ..\FeatureDetection\initial_cache.cmake -G "Visual Studio 11 Win64" ..\FeatureDetection
echo cmake -C ..\FeatureDetection\initial_cache.cmake -G "Visual Studio 12 Win64" ..\FeatureDetection
cmake -C ..\FeatureDetection\initial_cache.cmake -G "Visual Studio 12 Win64" ..\FeatureDetection
echo ---
echo from the build directory (you should currently be in the build directory).
echo.
Expand Down
20 changes: 10 additions & 10 deletions libRender/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ ELSE(Boost_FOUND)
MESSAGE(FATAL_ERROR "Boost not found")
ENDIF()

#HDF5: (needed for reading the Model)
#MESSAGE(STATUS "HDF5_ROOT: ${HDF5_ROOT}")
#SET( CMAKE_MODULE_PATH ${HDF5_ROOT}/cmake/hdf5 )
#MESSAGE(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
#FIND_PACKAGE( HDF5 REQUIRED COMPONENTS C CXX )
#FIND_PACKAGE( HDF5 NAMES hdf5 )
#SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
#FIND_PACKAGE( HDF5 NAMES hdf5 )
#IF(WIN32)
#FIND_PACKAGE (HDF5 NAMES hdf5) # puts it in Config-mode
#FIND_PACKAGE (HDF5 REQUIRED CONFIG) # same
FIND_PACKAGE (HDF5 REQUIRED COMPONENTS C CXX) # works on windows as well
#ENDIF()
#message(STATUS "Hdf5 include dir: ${HDF5_INCLUDE_DIR}") # According to hdf5 cmake file, should use *_DIRS, but they don't define it in hdf5-config.cmake. Ok if find_packaged used as above (now), it works.
message(STATUS "HDF5 includes at: ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5 libraries at: ${HDF5_LIBRARIES}")

#Source and header files:
SET(SOURCE
Expand Down Expand Up @@ -64,8 +64,8 @@ SET(HEADERS

include_directories( "include" )
include_directories( ${OpenCV_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES("C:\\Users\\Patrik\\Cloud\\PhD\\HDF5\\include\\hdf5\\")
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
include_directories( ${HDF5_INCLUDE_DIRS} )

#Make the library
add_library( ${SUBPROJECT_NAME} ${SOURCE} ${HEADERS} )
6 changes: 1 addition & 5 deletions libRender/include/render/Hdf5Utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@

#include "render/Mesh.hpp"

#ifdef WIN32 // This is a shitty hack... find out what the proper way to do this is. Probably include the hdf5.tar.gz in our cmake project. Bzw... without cpp is maybe correct, and my windows-installation is wrong?
#include "cpp/H5Cpp.h"
#else
#include "H5Cpp.h"
#endif
#include "H5Cpp.h"

#include "opencv2/core/core.hpp"

Expand Down
11 changes: 10 additions & 1 deletion libShapeModels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ SET( ${SUBPROJECT_NAME}_VERSION_MINOR 1 )
FIND_PACKAGE(Boost 1.48.0 REQUIRED)
FIND_PACKAGE(OpenCV 2.3.1 REQUIRED core calib3d)

#IF(WIN32)
#FIND_PACKAGE (HDF5 NAMES hdf5) # puts it in Config-mode
#FIND_PACKAGE (HDF5 REQUIRED CONFIG) # same
FIND_PACKAGE (HDF5 REQUIRED COMPONENTS C CXX) # works on windows as well
#ENDIF()
#message(STATUS "Hdf5 include dir: ${HDF5_INCLUDE_DIR}") # According to hdf5 cmake file, should use *_DIRS, but they don't define it in hdf5-config.cmake. Ok if find_packaged used as above (now), it works.
message(STATUS "HDF5 includes at: ${HDF5_INCLUDE_DIRS}")
message(STATUS "HDF5 libraries at: ${HDF5_LIBRARIES}")

# source and header files
SET(HEADERS
include/shapemodels/PcaModel.hpp
Expand Down Expand Up @@ -40,7 +49,7 @@ include_directories( "include" )
# add dependencies
include_directories( ${Boost_INCLUDE_DIRS} )
include_directories( ${OpenCV_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES("C:\\Users\\Patrik\\Cloud\\PhD\\HDF5\\include\\hdf5\\")
include_directories( ${HDF5_INCLUDE_DIRS} )
include_directories( ${ImageProcessing_SOURCE_DIR}/include )
include_directories( ${ImageIO_SOURCE_DIR}/include )
include_directories( ${Render_SOURCE_DIR}/include )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@

#include "logging/LoggerFactory.hpp"

#ifdef WIN32 // This is a shitty hack... find out what the proper way to do this is. Probably include the hdf5.tar.gz in our cmake project. Bzw... without cpp is maybe correct, and my windows-installation is wrong?
#include "cpp/H5Cpp.h"
#else
#include "H5Cpp.h"
#endif
//#include "hdf5.h"
#include "H5Cpp.h"

#include "boost/random/mersenne_twister.hpp"
#include "boost/random/uniform_int_distribution.hpp"
Expand Down
8 changes: 2 additions & 6 deletions libShapeModels/src/shapemodels/PcaModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@

#include "logging/LoggerFactory.hpp"

#ifdef WIN32 // This is a shitty hack... find out what the proper way to do this is. Probably include the hdf5.tar.gz in our cmake project. Bzw... without cpp is maybe correct, and my windows-installation is wrong?
#include "cpp/H5Cpp.h"
#else
#include "H5Cpp.h"
#endif
//#include "hdf5.h"
#include "H5Cpp.h"

#include "boost/lexical_cast.hpp"
#include "boost/algorithm/string.hpp"

Expand Down
59 changes: 59 additions & 0 deletions renderTestApp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
SET( SUBPROJECT_NAME renderTestApp ) # my own variable, not cmake's
PROJECT( ${SUBPROJECT_NAME} )
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
SET( ${SUBPROJECT_NAME}_VERSION_MAJOR 0 )
SET( ${SUBPROJECT_NAME}_VERSION_MINOR 1 )

find_package(OpenGL)

#OpenCV:
FIND_PACKAGE( OpenCV 2.3.1 REQUIRED core imgproc highgui calib3d )
MESSAGE(STATUS "OpenCV include dir found at ${OpenCV_INCLUDE_DIRS}")
MESSAGE(STATUS "OpenCV lib dir found at ${OpenCV_LIB_DIR}")

#Matlab:
SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
FIND_PACKAGE( MATLAB REQUIRED )
IF(MATLAB_FOUND)
MESSAGE(STATUS "Matlab found at ${MATLAB_INCLUDE_DIR}")
ELSE(MATLAB_FOUND)
MESSAGE(FATAL_ERROR "Matlab not found")
ENDIF(MATLAB_FOUND)

#Boost:
FIND_PACKAGE(Boost 1.48.0 COMPONENTS program_options system filesystem REQUIRED) # others (e.g.): system filesystem
if(Boost_FOUND)
MESSAGE(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
ELSE(Boost_FOUND)
MESSAGE(FATAL_ERROR "Boost not found")
ENDIF()

#Source and header files:
SET(SOURCE
renderTestApp.cpp
)

SET(HEADERS
)

ADD_EXECUTABLE( ${SUBPROJECT_NAME} ${SOURCE} ${HEADERS} )

INCLUDE_DIRECTORIES( ${MATLAB_INCLUDE_DIR} )
include_directories( ${Boost_INCLUDE_DIRS} )
include_directories( ${OpenCV_INCLUDE_DIRS} )
include_directories( ${Logging_SOURCE_DIR}/include )
include_directories( ${ImageLogging_SOURCE_DIR}/include )
include_directories( ${ImageIO_SOURCE_DIR}/include )
include_directories( ${ImageProcessing_SOURCE_DIR}/include )
include_directories( ${Classification_SOURCE_DIR}/include )
include_directories( ${Render_SOURCE_DIR}/include )
include_directories( ${ShapeModels_SOURCE_DIR}/include )
include_directories( ${Detection_SOURCE_DIR}/include )

# Hdf5 "hack":
INCLUDE_DIRECTORIES("C:\\Users\\Patrik\\Cloud\\PhD\\HDF5\\include\\hdf5\\")
link_directories( "C:\\Users\\Patrik\\Cloud\\PhD\\HDF5\\lib\\hdf5\\" )
set(HDF5_LIBRARIES debug hdf5d debug hdf5_cppd optimized hdf5; optimized hdf5_cpp)

#Make the app depend on the libraries
TARGET_LINK_LIBRARIES( ${SUBPROJECT_NAME} Detection ImageIO ${KINECT_LIBNAME} ImageProcessing Classification ShapeModels Render ImageLogging Logging ${OPENGL_LIBRARIES} ${Boost_LIBRARIES} ${MATLAB_MX_LIBRARY} ${MATLAB_MAT_LIBRARY} ${OpenCV_LIBS} ${HDF5_LIBRARIES} )
Loading

0 comments on commit 9bac0ae

Please sign in to comment.