C++ 二值图像中重叠对象的提取

C++ 二值图像中重叠对象的提取,c++,opencv,image-processing,C++,Opencv,Image Processing,我正在寻找一种方法来提取这个二值图像中的每一行 我使用C++的OpenCV库。 我尝试的方法是: Step 1: Thinning - resulted in lines with sharp curves when they shouldn't Step 2: follow the line's path. However, some part of the sample image resulted in thinning where it created intersec

我正在寻找一种方法来提取这个二值图像中的每一行

我使用C++的OpenCV库。 我尝试的方法是:

Step 1: Thinning - resulted in lines with sharp curves when they shouldn't
Step 2: follow the line's path. However, some part of the sample image resulted in 
        thinning where it created intersections that curve to wrong direction.
Step 3: Erode - all other objects outside the objects skeleton/thinning path.
我相信有很多更可靠的方法来解决这个问题。请引导我

多谢各位

示例图像:


您可以尝试使用距离变换。线性组合三个版本(L1、L2、C)。然后在其上应用高斯滤波器。最后做一个阈值


它比细化效果更好。

您可以尝试使用距离变换。线性组合三个版本(L1、L2、C)。然后在其上应用高斯滤波器。最后做一个阈值


这比稀释效果更好。

谢谢你的回答。作为一个整体,我是图像处理方面的新手。线性组合是什么意思?它意味着如果你有矩阵l1,l2,c中的结果,你说
Mat result=(l1+l2+c)/3。
谢谢你的回答。作为一个整体,我是图像处理方面的新手。线性组合是什么意思?它意味着如果你有矩阵l1,l2,c中的结果,你说
Mat result=(l1+l2+c)/3。