具有梯度填充区域的图像分割
我必须从事图像分割工作。这个想法是将图像划分为具有相似颜色或可以用梯度方程(线性或径向)表示的像素的区域。我发现了许多基于颜色进行分离的算法,但找不到处理渐变的任何算法。有人知道任何这样的算法或关于如何实现它的建议吗?
I have to work on image segmentation. The idea is to divide an image into regions which have pixels either of the similar color or the ones which can be represented by a gradient equation (linear or radial). I have found many algorithms which do the separation based on colors but could not find anyone which handles gradients. Does someone know any such algorithm or suggestions on how to go for it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
均值平移分割可能就是您正在寻找的。它在 OpenCV 中实现。它可以容忍平滑的渐变,从而产生更自然的结果,或者人类将图像转换为按数字绘制时会想出的东西。
这是使用均值平移分割的图像:
Mean-Shift Segmentation might be what you are looking for. It is implemented in OpenCV. It is tolerant of smooth gradients, yielding a more natural result, or something that a human would come up with if he was converting an image to a paint-by-number.
Here is an image that was segmented with mean-shift:
在梯度区域中,边缘函数(拉普拉斯算子或其他边缘检测函数)将检测不到边缘(结果将接近零(“黑色”))。因此,在图像上应用边缘滤镜,然后您将得到由明亮边缘(与原始图像存在强烈差异的地方)勾勒出的近黑色区域(对于渐变或其他类似颜色的部分)。大多数分割算法应该可以轻松地对该图像进行分割(如果它们将明亮边缘分类为自己的片段,则只需将边缘像素与最近的黑色区域合并回去)。
请注意,您可能只想首先查找并分割渐变区域,然后在原始(非边缘)图像。另请注意,边缘检测并不完全适用于径向梯度,因此您可能需要实际计算边缘函数两次以获得更好的结果
In gradient areas, the edge function (laplacian or other edge detection functions) will detect no edge (the result will be nearly zero ("black")). So, apply an edge filter on the image, and then you will have nearly black areas (for gradient or other similarly-colored sections) outlined by bright edges (where there was a strong difference in the original image). This image should be easily segmented by most segmentation algorithms (and if they classify the bright edges as their own segment, simply merge edge pixels back with the closest black area).
Note that you may want to find and segment only the gradient areas first, and then use a more decent segmentation algorithm on the original (non-edges) image. Note also that the edge detection doesn't work exactly for the radial gradients, so you may want to actually compute the edge function twice to acheive better results