Parker Schuh | 6691f19 | 2017-01-14 17:01:02 -0800 | [diff] [blame^] | 1 | #ifndef _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_ |
| 2 | #define _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_ |
| 3 | |
| 4 | #include <vector> |
| 5 | |
| 6 | #include "aos/vision/blob/contour.h" |
| 7 | #include "aos/vision/blob/range_image.h" |
| 8 | |
| 9 | namespace aos { |
| 10 | namespace vision { |
| 11 | |
| 12 | struct FittedLine { |
| 13 | Point st; |
| 14 | Point ed; |
| 15 | }; |
| 16 | |
| 17 | // Merges a contour into a list of best fit lines where the regression value is |
| 18 | // merge_rate and only emit lines at least min_len pixels long. |
| 19 | void HierarchicalMerge(ContourNode *stval, std::vector<FittedLine> *fit_lines, |
| 20 | float merge_rate = 4.0, int min_len = 15); |
| 21 | |
| 22 | } // namespace vision |
| 23 | } // namespace aos |
| 24 | |
| 25 | #endif // _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_ |