diff --git a/3rdparty/stasm4.0.0/stasm/hatdesc.cpp b/3rdparty/stasm4.0.0/stasm/hatdesc.cpp index e7a590f..479b1c7 100755 --- a/3rdparty/stasm4.0.0/stasm/hatdesc.cpp +++ b/3rdparty/stasm4.0.0/stasm/hatdesc.cpp @@ -9,16 +9,6 @@ #define CACHE 1 // define to 0 if your compiler doesn't support hash_map // Stasm runs faster if 1 -#if CACHE - // define hash_map, current implementations are compiler dependent (2013) - #ifdef _MSC_VER // microsoft - #include - using namespace stdext; - #else // assume gcc - #include - using namespace __gnu_cxx; - #endif -#endif namespace stasm { diff --git a/3rdparty/stasm4.0.0/stasm/stasm.cpp b/3rdparty/stasm4.0.0/stasm/stasm.cpp deleted file mode 100755 index 3264a8b..0000000 --- a/3rdparty/stasm4.0.0/stasm/stasm.cpp +++ /dev/null @@ -1,5 +0,0 @@ -// stasm.cpp: build precompiled headers (to speed up builds) -// -// Copyright (C) 2005-2013, Stephen Milborrow - -#include "stasm.h" diff --git a/openbr/plugins/pbd.cmake b/openbr/plugins/pbd.cmake deleted file mode 100644 index 5dcd28c..0000000 --- a/openbr/plugins/pbd.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(BR_WITH_PBD OFF CACHE BOOL "Build with PartsBasedDetector") - -if(${BR_WITH_PBD}) - find_package(PBD REQUIRED) - set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/pbd.cpp) - set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${PBD_LIBS}) - - if(WIN32) - install(DIRECTORY ${PBD_DIR}/lib/ DESTINATION bin) - else() - install(DIRECTORY ${PBD_DIR}/lib/ DESTINATION lib) - endif() - - install(DIRECTORY ${PBD_DIR}/models/ DESTINATION share/openbr/models/pbd) -endif() diff --git a/openbr/plugins/pbd.cpp b/openbr/plugins/pbd.cpp deleted file mode 100644 index f3e1089..0000000 --- a/openbr/plugins/pbd.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include - -#include - -#include "openbr_internal.h" - -#include "core/opencvutils.h" - -#include -#include - -#include "PartsBasedDetector.hpp" -#include "Candidate.hpp" -#include "FileStorageModel.hpp" -#include "Visualize.hpp" -#include "types.hpp" -#include "nms.hpp" -#include "Rect3.hpp" -#include "DistanceTransform.hpp" - -using namespace cv; - -namespace br -{ - -/*! - * \ingroup initializers - * \brief Initialize PBD - * \author Scott Klum \cite sklum - */ -class PBDInitializer : public Initializer -{ - Q_OBJECT - - void initialize() const - { - Globals->abbreviations.insert("RectFromPBDEyes","RectFromLandmarks([9, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 25],10,6.0)"); - Globals->abbreviations.insert("RectFromPBDNose","RectFromLandmarks([0, 1, 2, 3, 4, 5, 6, 7, 8],10)"); - Globals->abbreviations.insert("RectFromPBDBrow","RectFromLandmarks([15, 16, 17, 18, 19, 26, 27, 28, 29, 30],10)"); - Globals->abbreviations.insert("RectFromPBDMouth","RectFromLandmarks([31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50],10)"); - Globals->abbreviations.insert("RectFromPBDJaw","RectFromLandmarks([51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67],10)"); - } - - void finalize() const - { - - } -}; - -BR_REGISTER(Initializer, PBDInitializer) - -/*! - * \ingroup transforms - * \brief Wraps Parts Based Detector - * \author Scott Klum \cite sklum - * \note Some of the detected landmarks overlap - * \todo Remove print statements from pdb src, remove Boost dependency - */ - -class PBDTransform : public UntrainableTransform -{ - Q_OBJECT - - Q_PROPERTY(QString modelPath READ get_modelPath WRITE set_modelPath RESET reset_modelPath STORED false) - BR_PROPERTY(QString, modelPath, "") - - boost::scoped_ptr model; - - void init() - { - if (modelPath.isEmpty()) qFatal("No model file"); - - model.reset(new FileStorageModel); - - QFileInfo info(modelPath); - - if (info.suffix().compare("xml") == 0 || info.suffix().compare("yaml") == 0) model.reset(new FileStorageModel); - else qFatal("Unsupported model format: %s", qPrintable(info.suffix())); - - if (!(model->deserialize(info.filePath().toStdString()))) qFatal("Error deserializing model, check file path"); - } - - void project(const Template &src, Template &dst) const - { - dst = src.m().clone(); - - PartsBasedDetector pbd; - pbd.distributeModel(*model); - - Mat_ depth; - - // Detect potential candidates in the image - vector candidates; - pbd.detect(src.m(), depth, candidates); - - if (Globals->verbose) qDebug("%li candidate detected for %s", candidates.size(), qPrintable(src.file.flat())); - - // Sort the candidates by score, then supress all but the candidate with the maximum score - if (candidates.size() > 0) { - Candidate::sort(candidates); - Candidate::nonMaximaSuppression(src.m(), candidates, 0.2); - foreach ( const cv::Rect part, candidates[0].parts() ) - dst.file.appendLandmark(QPointF(part.x + part.width/2.0, part.y + part.height/2.0)); - } - } -}; - -BR_REGISTER(Transform, PBDTransform) - -} // namespace br - -#include "pbd.moc" - diff --git a/openbr/plugins/stasm3.cmake b/openbr/plugins/stasm3.cmake deleted file mode 100644 index 8e2fd52..0000000 --- a/openbr/plugins/stasm3.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(BR_WITH_STASM3 OFF CACHE BOOL "Build with Stasm") - -if(${BR_WITH_STASM3}) - find_package(Stasm3 REQUIRED) - set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/stasm3.cpp) - set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Stasm3_LIBS}) - - if(WIN32) - install(DIRECTORY ${Stasm_DIR}/build/ DESTINATION bin) - else() - install(DIRECTORY ${Stasm_DIR}/build/ DESTINATION lib) - endif() - - install(DIRECTORY ${Stasm_DIR}/models/ DESTINATION share/openbr/models/stasm) -endif() diff --git a/openbr/plugins/stasm4.cmake b/openbr/plugins/stasm4.cmake index 8d7e543..42c8de5 100644 --- a/openbr/plugins/stasm4.cmake +++ b/openbr/plugins/stasm4.cmake @@ -1,4 +1,4 @@ -set(BR_WITH_STASM4 OFF CACHE BOOL "Build with Stasm") +set(BR_WITH_STASM4 ON CACHE BOOL "Build with Stasm") if(${BR_WITH_STASM4}) find_package(Stasm4 REQUIRED) diff --git a/openbr/plugins/validate.cpp b/openbr/plugins/validate.cpp index 71ef72f..233268c 100644 --- a/openbr/plugins/validate.cpp +++ b/openbr/plugins/validate.cpp @@ -275,8 +275,7 @@ class RejectDistance : public Distance (void) b; foreach (const QString &key, keys) - if ((rejectIfContains && a.file.contains(key)) || - (!rejectIfContains && !a.file.contains(key))) + if ((rejectIfContains && a.file.contains(key)) || (!rejectIfContains && !a.file.contains(key))) return -std::numeric_limits::max(); return 0; diff --git a/share/openbr/cmake/FindPBD.cmake b/share/openbr/cmake/FindPBD.cmake deleted file mode 100644 index e2044f9..0000000 --- a/share/openbr/cmake/FindPBD.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# ================================================================ -# The PartsBasedDetector CMake configuration file -# -# Usage from an external project: -# In your CMakeLists.txt, add these lines: -# -# find_package(PBD REQUIRED) -# target_link_libraries(MY_TARGET ${PBD_LIBS}) -# ================================================================ - -find_path(PBD_DIR include/Candidate.hpp ${CMAKE_SOURCE_DIR}/3rdparty/*) -include_directories(${PBD_DIR}/include) -link_directories(${PBD_DIR}/lib) - -find_package(Boost COMPONENTS system serialization REQUIRED) -include_directories(${Boost_INCLUDE_DIR}) -link_directories(${Boost_LIBRARY_DIRS}) -set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Boost_LIBRARIES}) - -set(PBD_LIBS PartsBasedDetector) diff --git a/share/openbr/cmake/FindStasm3.cmake b/share/openbr/cmake/FindStasm3.cmake deleted file mode 100644 index 4ccac5c..0000000 --- a/share/openbr/cmake/FindStasm3.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# ================================================================ -# The Stasm CMake configuration file -# -# Usage from an external project: -# In your CMakeLists.txt, add these lines: -# -# find_package(Stasm3 REQUIRED) -# target_link_libraries(MY_TARGET ${Stasm4_LIBS}) -# ================================================================ - -find_path(Stasm_DIR include/stasm.hpp ${CMAKE_SOURCE_DIR}/3rdparty/*) - -add_subdirectory(${Stasm_DIR} ${Stasm_DIR}/build) - -set(SRC ${SOURCE};${SRC}) - -include_directories(${Stasm_DIR}/include) -link_directories(${Stasm_DIR}/build) - -set(Stasm3_LIBS stasm)