#ifndef LINE_CONTINUITY_DETECTION_H #define LINE_CONTINUITY_DETECTION_H #include class LineContinuityDetection { public: LineContinuityDetection(); static bool isContinuous(const cv::Mat& image, double area_threshold = 100); private: /// /// 获取连通区域轮廓 /// /// 源图像 /// 结果轮廓集 /// 轮廓集的排序关系。与contours的数量对应,受retr选项不同,排序会有变化 /// 轮廓集排序方式,默认为链式排序 /// 查找算法选择,默认为普通查找 /// 查找起始点,默认为(0,0)点 static void myFindContours(const cv::Mat& src, std::vector>& contours, std::vector& hierarchy, int retr = cv::RETR_LIST, int method = cv::CHAIN_APPROX_SIMPLE, cv::Point offset = cv::Point(0, 0)); static bool findBlock(const std::vector>& contours, const std::vector& hierarchy, double area_threshold); }; #endif //LINE_CONTINUITY_DETECTION_H