Checking in blob routines.
Change-Id: I364331d6f9239763ccac492460ed752a0b16871f
diff --git a/aos/vision/blob/hierarchical_contour_merge.h b/aos/vision/blob/hierarchical_contour_merge.h
new file mode 100644
index 0000000..9dd471d
--- /dev/null
+++ b/aos/vision/blob/hierarchical_contour_merge.h
@@ -0,0 +1,25 @@
+#ifndef _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_
+#define _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_
+
+#include <vector>
+
+#include "aos/vision/blob/contour.h"
+#include "aos/vision/blob/range_image.h"
+
+namespace aos {
+namespace vision {
+
+struct FittedLine {
+ Point st;
+ Point ed;
+};
+
+// Merges a contour into a list of best fit lines where the regression value is
+// merge_rate and only emit lines at least min_len pixels long.
+void HierarchicalMerge(ContourNode *stval, std::vector<FittedLine> *fit_lines,
+ float merge_rate = 4.0, int min_len = 15);
+
+} // namespace vision
+} // namespace aos
+
+#endif // _AOS_VISION_BLOB_HIERARCHICAL_CONTOUR_MERGE_H_