Commit 5bab078d793f155fdba69c2e92785b7a37cfe20a
1 parent
068b72ad
Do not flatten to a single Mat in CatCols
Showing
1 changed file
with
8 additions
and
6 deletions
openbr/plugins/regions.cpp
| ... | ... | @@ -141,13 +141,15 @@ class CatColsTransform : public UntrainableMetaTransform |
| 141 | 141 | |
| 142 | 142 | void project(const Template &src, Template &dst) const |
| 143 | 143 | { |
| 144 | + int half = src.size()/2; | |
| 145 | + for (int i=0; i<half; i++) { | |
| 146 | + Mat first = src[i]; | |
| 147 | + Mat second = src[half+i]; | |
| 148 | + Mat both; | |
| 149 | + hconcat(first, second, both); | |
| 150 | + dst.append(both); | |
| 151 | + } | |
| 144 | 152 | dst.file = src.file; |
| 145 | - Mat m = OpenCVUtils::toMatByRow(src); | |
| 146 | - // right now this just splits src in half and joins them horizontally | |
| 147 | - // TODO: add partitions parameter for more than a single split | |
| 148 | - Mat first = m.rowRange(Range(0, m.rows/2)); | |
| 149 | - Mat second = m.rowRange(Range(m.rows/2, m.rows)); | |
| 150 | - hconcat(first, second, dst); | |
| 151 | 153 | } |
| 152 | 154 | }; |
| 153 | 155 | ... | ... |