Commit 4a6579ea7efa0338c0a0f5e29d7c2c2fda8d0127
1 parent
ef0d1dae
added SplitRowsTransform
Showing
1 changed file
with
20 additions
and
1 deletions
openbr/plugins/imgproc/splitchannels.cpp renamed to openbr/plugins/imgproc/split.cpp
| @@ -43,6 +43,25 @@ class SplitChannelsTransform : public UntrainableTransform | @@ -43,6 +43,25 @@ class SplitChannelsTransform : public UntrainableTransform | ||
| 43 | 43 | ||
| 44 | BR_REGISTER(Transform, SplitChannelsTransform) | 44 | BR_REGISTER(Transform, SplitChannelsTransform) |
| 45 | 45 | ||
| 46 | +/*! | ||
| 47 | + * \ingroup transforms | ||
| 48 | + * \brief Split a multi-channel matrix into several single-channel matrices. | ||
| 49 | + * \author Josh Klontz \cite jklontz | ||
| 50 | + */ | ||
| 51 | +class SplitRowsTransform : public UntrainableTransform | ||
| 52 | +{ | ||
| 53 | + Q_OBJECT | ||
| 54 | + | ||
| 55 | + void project(const Template &src, Template &dst) const | ||
| 56 | + { | ||
| 57 | + const Mat &m = src; | ||
| 58 | + for (int i=0; i<m.rows; i++) | ||
| 59 | + dst += m.row(i); | ||
| 60 | + } | ||
| 61 | +}; | ||
| 62 | + | ||
| 63 | +BR_REGISTER(Transform, SplitRowsTransform) | ||
| 64 | + | ||
| 46 | } // namespace br | 65 | } // namespace br |
| 47 | 66 | ||
| 48 | -#include "imgproc/splitchannels.moc" | 67 | +#include "imgproc/split.moc" |