Commit f7693ac5ca4d952ad2d7a1f13039e89b0be03922
1 parent
3b730b32
Fixed some careless coding
Showing
1 changed file
with
4 additions
and
4 deletions
openbr/plugins/imgproc/fillcontours.cpp
| @@ -33,9 +33,9 @@ class FillContoursTransform : public UntrainableTransform | @@ -33,9 +33,9 @@ class FillContoursTransform : public UntrainableTransform | ||
| 33 | Q_OBJECT | 33 | Q_OBJECT |
| 34 | 34 | ||
| 35 | Q_PROPERTY(float epsilon READ get_epsilon WRITE set_epsilon RESET reset_epsilon STORED false) | 35 | Q_PROPERTY(float epsilon READ get_epsilon WRITE set_epsilon RESET reset_epsilon STORED false) |
| 36 | - Q_PROPERTY(float minSize READ get_minSize WRITE set_minSize RESET reset_minSize STORED false) | ||
| 37 | - BR_PROPERTY(float, epsilon, 3) | ||
| 38 | - BR_PROPERTY(int, minSize, 40) | 36 | + Q_PROPERTY(size_t minSize READ get_minSize WRITE set_minSize RESET reset_minSize STORED false) |
| 37 | + BR_PROPERTY(float, epsilon, 0) | ||
| 38 | + BR_PROPERTY(size_t, minSize, 40) | ||
| 39 | 39 | ||
| 40 | void project(const Template &src, Template &dst) const | 40 | void project(const Template &src, Template &dst) const |
| 41 | { | 41 | { |
| @@ -47,7 +47,7 @@ class FillContoursTransform : public UntrainableTransform | @@ -47,7 +47,7 @@ class FillContoursTransform : public UntrainableTransform | ||
| 47 | /// Find contours | 47 | /// Find contours |
| 48 | findContours(src.m(), contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0)); | 48 | findContours(src.m(), contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, Point(0, 0)); |
| 49 | 49 | ||
| 50 | - if (smooth) | 50 | + if (epsilon > 0) |
| 51 | for(size_t i=0; i<contours.size(); i++) | 51 | for(size_t i=0; i<contours.size(); i++) |
| 52 | approxPolyDP(Mat(contours[i]), contours[i], epsilon, true); | 52 | approxPolyDP(Mat(contours[i]), contours[i], epsilon, true); |
| 53 | 53 |