Commit f58c9b502c269dd5ba4b393ee61a6ed4b78c9e37
1 parent
ba1580c3
Add an outputVariable scheme to LargestConvexArea
Showing
1 changed file
with
4 additions
and
1 deletions
openbr/plugins/mask.cpp
| @@ -158,6 +158,9 @@ class LargestConvexAreaTransform : public UntrainableTransform | @@ -158,6 +158,9 @@ class LargestConvexAreaTransform : public UntrainableTransform | ||
| 158 | { | 158 | { |
| 159 | Q_OBJECT | 159 | Q_OBJECT |
| 160 | 160 | ||
| 161 | + Q_PROPERTY(QString outputVariable READ get_outputVariable WRITE set_outputVariable RESET reset_outputVariable STORED false) | ||
| 162 | + BR_PROPERTY(QString, outputVariable, "Label") | ||
| 163 | + | ||
| 161 | void project(const Template &src, Template &dst) const | 164 | void project(const Template &src, Template &dst) const |
| 162 | { | 165 | { |
| 163 | std::vector< std::vector<Point> > contours; | 166 | std::vector< std::vector<Point> > contours; |
| @@ -171,7 +174,7 @@ class LargestConvexAreaTransform : public UntrainableTransform | @@ -171,7 +174,7 @@ class LargestConvexAreaTransform : public UntrainableTransform | ||
| 171 | if (area / hullArea > 0.98) | 174 | if (area / hullArea > 0.98) |
| 172 | maxArea = std::max(maxArea, area); | 175 | maxArea = std::max(maxArea, area); |
| 173 | } | 176 | } |
| 174 | - dst.file.set("Label", maxArea); | 177 | + dst.file.set(outputVariable, maxArea); |
| 175 | } | 178 | } |
| 176 | }; | 179 | }; |
| 177 | 180 |