Commit cd57ef8c6ef0ffe18cfc61359e7ab55156e0dc3f
1 parent
f989f182
Stasm complete
Showing
5 changed files
with
33 additions
and
4 deletions
sdk/plugins/nec3.cmake
sdk/plugins/stasm.cmake
0 → 100644
| 1 | +set(BR_WITH_STASM OFF CACHE BOOL "Build with Stasm") | ||
| 2 | + | ||
| 3 | +if(${BR_WITH_STASM}) | ||
| 4 | + find_package(Stasm REQUIRED) | ||
| 5 | + set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} plugins/stasm.cpp) | ||
| 6 | + set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Stasm_LIBS}) | ||
| 7 | + | ||
| 8 | + if(WIN32) | ||
| 9 | + install(DIRECTORY ${Stasm_DIR}/lib/ DESTINATION bin) | ||
| 10 | + else() | ||
| 11 | + install(DIRECTORY ${Stasm_DIR}/lib/ DESTINATION lib) | ||
| 12 | + endif() | ||
| 13 | + | ||
| 14 | + install(DIRECTORY ${Stasm_DIR}/models/ DESTINATION share/openbr/models/stasm) | ||
| 15 | +endif() |
sdk/plugins/stasm.cpp
| @@ -56,7 +56,7 @@ class StasmTransform : public UntrainableTransform | @@ -56,7 +56,7 @@ class StasmTransform : public UntrainableTransform | ||
| 56 | 56 | ||
| 57 | AsmSearchDll(&nlandmarks, landmarks, | 57 | AsmSearchDll(&nlandmarks, landmarks, |
| 58 | src.file.name.toStdString().c_str(), reinterpret_cast<char*>(src.m().data), src.m().cols, src.m().rows, | 58 | src.file.name.toStdString().c_str(), reinterpret_cast<char*>(src.m().data), src.m().cols, src.m().rows, |
| 59 | - src.m(), (src.m().channels() == 3), NULL, NULL); | 59 | + src.m(), (src.m().channels() == 3), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-68-1d.conf"), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-76-2d.conf")); |
| 60 | 60 | ||
| 61 | if (nlandmarks == 0) qFatal("Unable to detect Stasm landmarks"); | 61 | if (nlandmarks == 0) qFatal("Unable to detect Stasm landmarks"); |
| 62 | 62 |
share/openbr/cmake/FindPBD.cmake
| @@ -13,8 +13,6 @@ include_directories(${PBD_DIR}/include) | @@ -13,8 +13,6 @@ include_directories(${PBD_DIR}/include) | ||
| 13 | link_directories(${PBD_DIR}/lib) | 13 | link_directories(${PBD_DIR}/lib) |
| 14 | 14 | ||
| 15 | find_package(Boost COMPONENTS system serialization REQUIRED) | 15 | find_package(Boost COMPONENTS system serialization REQUIRED) |
| 16 | -message(${Boost_INCLUDE_DIR}) | ||
| 17 | -message(${Boost_LIBRARIES}) | ||
| 18 | include_directories(${Boost_INCLUDE_DIR}) | 16 | include_directories(${Boost_INCLUDE_DIR}) |
| 19 | link_directories(${Boost_LIBRARY_DIRS}) | 17 | link_directories(${Boost_LIBRARY_DIRS}) |
| 20 | set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Boost_LIBRARIES}) | 18 | set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} ${Boost_LIBRARIES}) |
share/openbr/cmake/FindStasm.cmake
0 → 100644
| 1 | +# ================================================================ | ||
| 2 | +# The Stasm CMake configuration file | ||
| 3 | +# | ||
| 4 | +# Usage from an external project: | ||
| 5 | +# In your CMakeLists.txt, add these lines: | ||
| 6 | +# | ||
| 7 | +# find_package(Stasm REQUIRED) | ||
| 8 | +# target_link_libraries(MY_TARGET ${Stasm_LIBS}) | ||
| 9 | +# ================================================================ | ||
| 10 | + | ||
| 11 | +find_path(Stasm_DIR include/stasm.hpp ${CMAKE_SOURCE_DIR}/3rdparty/*) | ||
| 12 | + | ||
| 13 | +include_directories(${Stasm_DIR}/include) | ||
| 14 | +link_directories(${Stasm_DIR}/lib) | ||
| 15 | + | ||
| 16 | +set(Stasm_LIBS stasm) |