Commit b5b624a418279480133586a03dd5513f5b00605e
1 parent
626dd7d8
generalized SplitRows to include step
Showing
1 changed file
with
4 additions
and
2 deletions
openbr/plugins/imgproc/split.cpp
| @@ -51,12 +51,14 @@ BR_REGISTER(Transform, SplitChannelsTransform) | @@ -51,12 +51,14 @@ BR_REGISTER(Transform, SplitChannelsTransform) | ||
| 51 | class SplitRowsTransform : public UntrainableTransform | 51 | class SplitRowsTransform : public UntrainableTransform |
| 52 | { | 52 | { |
| 53 | Q_OBJECT | 53 | Q_OBJECT |
| 54 | + Q_PROPERTY(int step READ get_step WRITE set_step RESET reset_step STORED false) | ||
| 55 | + BR_PROPERTY(int, step, 1) | ||
| 54 | 56 | ||
| 55 | void project(const Template &src, Template &dst) const | 57 | void project(const Template &src, Template &dst) const |
| 56 | { | 58 | { |
| 57 | const Mat &m = src; | 59 | const Mat &m = src; |
| 58 | - for (int i=0; i<m.rows; i++) | ||
| 59 | - dst += m.row(i); | 60 | + for (int i=0; i<m.rows; i += step) |
| 61 | + dst += m.rowRange(i, i + step); | ||
| 60 | } | 62 | } |
| 61 | }; | 63 | }; |
| 62 | 64 |