Commit beb638b84e9081697f9b18383bec88c3196dfbd8
1 parent
579362d5
added option to specify channel count in ReshapeTransform
Showing
1 changed file
with
3 additions
and
1 deletions
openbr/plugins/imgproc/reshape.cpp
| ... | ... | @@ -28,11 +28,13 @@ class ReshapeTransform : public UntrainableTransform |
| 28 | 28 | { |
| 29 | 29 | Q_OBJECT |
| 30 | 30 | Q_PROPERTY(int rows READ get_rows WRITE set_rows RESET reset_rows STORED false) |
| 31 | + Q_PROPERTY(int channels READ get_channels WRITE set_channels RESET reset_channels STORED false) | |
| 31 | 32 | BR_PROPERTY(int, rows, 1) |
| 33 | + BR_PROPERTY(int, channels, -1) | |
| 32 | 34 | |
| 33 | 35 | void project(const Template &src, Template &dst) const |
| 34 | 36 | { |
| 35 | - dst = src.m().reshape(src.m().channels(), rows); | |
| 37 | + dst = src.m().reshape(channels == -1 ? src.m().channels() : channels, rows); | |
| 36 | 38 | } |
| 37 | 39 | }; |
| 38 | 40 | ... | ... |