Commit c6b90e41b850da07daccd7bf0981c3a2da365aff
Merge branch 'master' of https://github.com/biometrics/openbr
Showing
3 changed files
with
41 additions
and
17 deletions
openbr/plugins/cmake/stasm4.cmake
| @@ -2,14 +2,7 @@ set(BR_WITH_STASM4 ON CACHE BOOL "Build with Stasm") | @@ -2,14 +2,7 @@ set(BR_WITH_STASM4 ON CACHE BOOL "Build with Stasm") | ||
| 2 | 2 | ||
| 3 | if(${BR_WITH_STASM4}) | 3 | if(${BR_WITH_STASM4}) |
| 4 | find_package(Stasm4 REQUIRED) | 4 | find_package(Stasm4 REQUIRED) |
| 5 | - set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Stasm4_LIBS}) | ||
| 6 | - | ||
| 7 | - if(WIN32) | ||
| 8 | - install(DIRECTORY ${Stasm_DIR}/build/ DESTINATION bin) | ||
| 9 | - else() | ||
| 10 | - install(DIRECTORY ${Stasm_DIR}/build/ DESTINATION lib) | ||
| 11 | - endif() | ||
| 12 | - | 5 | + set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} ${Stasm_SRC}) |
| 13 | install(DIRECTORY ${Stasm_DIR}/data/ DESTINATION share/openbr/models/stasm) | 6 | install(DIRECTORY ${Stasm_DIR}/data/ DESTINATION share/openbr/models/stasm) |
| 14 | else() | 7 | else() |
| 15 | set(BR_EXCLUDED_PLUGINS ${BR_EXCLUDED_PLUGINS} plugins/metadata/stasm4.cpp) | 8 | set(BR_EXCLUDED_PLUGINS ${BR_EXCLUDED_PLUGINS} plugins/metadata/stasm4.cpp) |
openbr/plugins/core/propagate.cpp
0 → 100644
| 1 | +#include <openbr/plugins/openbr_internal.h> | ||
| 2 | + | ||
| 3 | +namespace br | ||
| 4 | +{ | ||
| 5 | + | ||
| 6 | +/*! | ||
| 7 | + * \ingroup transforms | ||
| 8 | + * \brief Ensures that a template will be propogated. | ||
| 9 | + * \author Scott Klum \cite sklum | ||
| 10 | + */ | ||
| 11 | +class PropagateTransform : public Transform | ||
| 12 | +{ | ||
| 13 | + Q_OBJECT | ||
| 14 | + | ||
| 15 | + Q_PROPERTY(br::Transform *transform READ get_transform WRITE set_transform RESET reset_transform STORED true) | ||
| 16 | + BR_PROPERTY(br::Transform *, transform, NULL) | ||
| 17 | + | ||
| 18 | + void train(const TemplateList &data) | ||
| 19 | + { | ||
| 20 | + transform->train(data); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + void project(const Template &src, Template &dst) const | ||
| 24 | + { | ||
| 25 | + transform->project(src,dst); | ||
| 26 | + if (dst.isEmpty()) | ||
| 27 | + dst = src; | ||
| 28 | + } | ||
| 29 | +}; | ||
| 30 | + | ||
| 31 | +BR_REGISTER(Transform, PropagateTransform) | ||
| 32 | + | ||
| 33 | +} // namespace br | ||
| 34 | + | ||
| 35 | +#include "core/propagate.moc" |
share/openbr/cmake/FindStasm4.cmake
| @@ -8,13 +8,9 @@ | @@ -8,13 +8,9 @@ | ||
| 8 | # target_link_libraries(MY_TARGET ${Stasm4_LIBS}) | 8 | # target_link_libraries(MY_TARGET ${Stasm4_LIBS}) |
| 9 | # ================================================================ | 9 | # ================================================================ |
| 10 | 10 | ||
| 11 | -find_path(Stasm_DIR stasm/stasm_lib.h ${CMAKE_SOURCE_DIR}/3rdparty/*) | ||
| 12 | - | ||
| 13 | -add_subdirectory(${Stasm_DIR} ${Stasm_DIR}/build) | ||
| 14 | - | ||
| 15 | -set(SRC ${SOURCE};${SRC}) | ||
| 16 | - | 11 | +find_path(Stasm_DIR stasm/stasm_lib.h ${CMAKE_SOURCE_DIR}/3rdparty/* NO_DEFAULT_PATH) |
| 12 | +mark_as_advanced(Stasm_DIR) | ||
| 17 | include_directories(${Stasm_DIR}/stasm) | 13 | include_directories(${Stasm_DIR}/stasm) |
| 18 | -link_directories(${Stasm_DIR}/build) | ||
| 19 | - | ||
| 20 | -set(Stasm4_LIBS stasm) | 14 | +include_directories(${Stasm_DIR}/stasm/MOD_1) |
| 15 | +file(GLOB Stasm_SRC "${Stasm_DIR}/stasm/*.cpp") | ||
| 16 | +file(GLOB Stasm_SRC ${Stasm_SRC} "${Stasm_DIR}/stasm/MOD_1/*.cpp") |