Commit 405bf5f32466b884634eb588d9a717a605470414
1 parent
63c3361b
Add InterestRegions transform
Showing
1 changed file
with
19 additions
and
0 deletions
openbr/plugins/regions.cpp
| @@ -58,6 +58,25 @@ BR_REGISTER(Transform, RectRegionsTransform) | @@ -58,6 +58,25 @@ BR_REGISTER(Transform, RectRegionsTransform) | ||
| 58 | 58 | ||
| 59 | /*! | 59 | /*! |
| 60 | * \ingroup transforms | 60 | * \ingroup transforms |
| 61 | + * \brief Subdivide matrix into rectangular subregions based on interest points. | ||
| 62 | + * \author Austin Blanton \cite imaus10 | ||
| 63 | + */ | ||
| 64 | +class InterestRegionsTransform : public UntrainableTransform | ||
| 65 | +{ | ||
| 66 | + Q_OBJECT | ||
| 67 | + | ||
| 68 | + void project(const Template &src, Template &dst) const | ||
| 69 | + { | ||
| 70 | + const Mat &m = src; | ||
| 71 | + foreach (const Rect &rect, OpenCVUtils::toRects(src.file.rects())) | ||
| 72 | + dst += m(rect); | ||
| 73 | + } | ||
| 74 | +}; | ||
| 75 | + | ||
| 76 | +BR_REGISTER(Transform, InterestRegionsTransform) | ||
| 77 | + | ||
| 78 | +/*! | ||
| 79 | + * \ingroup transforms | ||
| 61 | * \brief Turns each row into its own matrix. | 80 | * \brief Turns each row into its own matrix. |
| 62 | * \author Josh Klontz \cite jklontz | 81 | * \author Josh Klontz \cite jklontz |
| 63 | */ | 82 | */ |