diff --git a/CMakeLists.txt b/CMakeLists.txt index d4c573f..ae24144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,13 +108,6 @@ if(${BR_WITH_CVMATIO}) set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} cvmatio) endif() -# Find OpenMP -find_package(OpenMP) -if (OPENMP_FOUND) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -endif() - # Compiler flags if(UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-strict-overflow -Wno-comment -Wno-unknown-pragmas -fvisibility=hidden -fno-omit-frame-pointer") diff --git a/openbr/plugins/metadata/randomtemplates.cpp b/openbr/plugins/metadata/randomtemplates.cpp new file mode 100644 index 0000000..466a3a4 --- /dev/null +++ b/openbr/plugins/metadata/randomtemplates.cpp @@ -0,0 +1,34 @@ +#include + +namespace br +{ + +/*! + * \ingroup transforms + * \author Brendan Klare \cite bklare + * \brief Randomly sample templates from a gallery + */ +class RandomTemplatesTransform : public UntrainableMetaTransform +{ + Q_OBJECT + Q_PROPERTY(float percent READ get_percent WRITE set_percent RESET reset_percent) + BR_PROPERTY(float, percent, .01) + + void project(const Template &src, Template &dst) const { + qFatal("Not supported in RandomTemplates."); + } + + void project(const TemplateList &src, TemplateList &dst) const { + for (int i = 0; i < src.size(); i++) { + const float r = static_cast (rand()) / static_cast (RAND_MAX); + if (r <= percent) + dst.append(src[i]); + } + } +}; +BR_REGISTER(Transform, RandomTemplatesTransform) + +} // namespace br + +#include "imgproc/randomtemplates.moc" + diff --git a/openbr/plugins/metadata/removefte.cpp b/openbr/plugins/metadata/removefte.cpp new file mode 100644 index 0000000..17b3ceb --- /dev/null +++ b/openbr/plugins/metadata/removefte.cpp @@ -0,0 +1,32 @@ +#include + +namespace br +{ + +/*! + * \ingroup transforms + * \author Brendan Klare \cite bklare + * \brief Remove any templates that failed to enroll (FTE) + */ +class RemoveFTETransform : public UntrainableMetaTransform +{ + Q_OBJECT + + void project(const Template &src, Template &dst) const + { + qFatal("Not supported in RemoveFTE."); + } + + void project(const TemplateList &src, TemplateList &dst) const + { + for (int i = 0; i < src.size(); i++) + if (!src[i].file.fte) + dst.append(src[i]); + } +}; +BR_REGISTER(Transform, RemoveFTETransform) + +} // namespace br + +#include "imgproc/removefte.moc" +