Commit beb638b84e9081697f9b18383bec88c3196dfbd8

Authored by Josh Klontz
1 parent 579362d5

added option to specify channel count in ReshapeTransform

openbr/plugins/imgproc/reshape.cpp
@@ -28,11 +28,13 @@ class ReshapeTransform : public UntrainableTransform @@ -28,11 +28,13 @@ class ReshapeTransform : public UntrainableTransform
28 { 28 {
29 Q_OBJECT 29 Q_OBJECT
30 Q_PROPERTY(int rows READ get_rows WRITE set_rows RESET reset_rows STORED false) 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 BR_PROPERTY(int, rows, 1) 32 BR_PROPERTY(int, rows, 1)
  33 + BR_PROPERTY(int, channels, -1)
32 34
33 void project(const Template &src, Template &dst) const 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