From 405bf5f32466b884634eb588d9a717a605470414 Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Mon, 29 Jul 2013 15:42:08 -0400 Subject: [PATCH] Add InterestRegions transform --- openbr/plugins/regions.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+), 0 deletions(-) diff --git a/openbr/plugins/regions.cpp b/openbr/plugins/regions.cpp index 57cbf6f..a47da88 100644 --- a/openbr/plugins/regions.cpp +++ b/openbr/plugins/regions.cpp @@ -58,6 +58,25 @@ BR_REGISTER(Transform, RectRegionsTransform) /*! * \ingroup transforms + * \brief Subdivide matrix into rectangular subregions based on interest points. + * \author Austin Blanton \cite imaus10 + */ +class InterestRegionsTransform : public UntrainableTransform +{ + Q_OBJECT + + void project(const Template &src, Template &dst) const + { + const Mat &m = src; + foreach (const Rect &rect, OpenCVUtils::toRects(src.file.rects())) + dst += m(rect); + } +}; + +BR_REGISTER(Transform, InterestRegionsTransform) + +/*! + * \ingroup transforms * \brief Turns each row into its own matrix. * \author Josh Klontz \cite jklontz */ -- libgit2 0.21.4