Commit 5efddc3d0a1b06a9e1fc1f83c23ad03fe923edde
1 parent
b4643c2a
Added bool to control dup of landmarks
Showing
1 changed file
with
10 additions
and
6 deletions
openbr/plugins/regions.cpp
| ... | ... | @@ -242,19 +242,23 @@ class DupTransform : public UntrainableMetaTransform |
| 242 | 242 | { |
| 243 | 243 | Q_OBJECT |
| 244 | 244 | Q_PROPERTY(int n READ get_n WRITE set_n RESET reset_n STORED false) |
| 245 | + Q_PROPERTY(bool dupLandmarks READ get_dupLandmarks WRITE set_dupLandmarks RESET reset_dupLandmarks STORED false) | |
| 245 | 246 | BR_PROPERTY(int, n, 1) |
| 247 | + BR_PROPERTY(bool, dupLandmarks, false) | |
| 246 | 248 | |
| 247 | 249 | void project(const Template &src, Template &dst) const |
| 248 | 250 | { |
| 249 | - QList<QPointF> points = src.file.points(); | |
| 250 | - QList<QRectF> rects = src.file.rects(); | |
| 251 | - | |
| 252 | 251 | for (int i=0; i<n; i++) |
| 253 | 252 | dst.merge(src); |
| 254 | 253 | |
| 255 | - for (int i=1; i<n; i++) { | |
| 256 | - dst.file.appendPoints(points); | |
| 257 | - dst.file.appendRects(rects); | |
| 254 | + if (dupLandmarks) { | |
| 255 | + QList<QPointF> points = src.file.points(); | |
| 256 | + QList<QRectF> rects = src.file.rects(); | |
| 257 | + | |
| 258 | + for (int i=1; i<n; i++) { | |
| 259 | + dst.file.appendPoints(points); | |
| 260 | + dst.file.appendRects(rects); | |
| 261 | + } | |
| 258 | 262 | } |
| 259 | 263 | } |
| 260 | 264 | }; | ... | ... |