简体   繁体   English

从二值图像中平滑边界提取

[英]Smooth Boundary Extraction from a Binary Image

I'm trying to extract the boundary between two regions in an image programmatically. 我正在尝试以编程方式提取图像中两个区域之间的边界。 I've got the hard bits figured out, so that I have a binary image that contains the boundary and plenty of noise. 我已经弄清了一些困难的地方,所以我得到了一个包含边界和大量噪声的二进制图像。 样本图片 . Cropping the areas outside isn't an issue. 修剪外面的区域不是问题。

The boundary in the image is afflicted both by noise (bottom-left for example) and some areas of discontinuity. 图像的边界受噪声(例如,左下角)和某些不连续区域的影响。 That means I can't simply select the shape based on one known pixel. 这意味着我不能简单地基于一个已知像素选择形状。

The problem left to me is pretty simple - I only really need to fill the gaps in the boundary and smooth it out, so that I am left with something smooth and continuous that I can extract afterwards. 留给我的问题很简单-我只需要真正填补边界中的空白并使其平滑即可,这样我就可以获得可以连续提取的平滑连续的东西。 That doesn't sound like a particularly hard problem for images like this, but I'm completely lost. 对于这样的图像,这听起来并不是一个特别困难的问题,但是我完全迷失了。 What algorithms or strategies could I possible use in order to turn this image into something useful? 为了将这张图片变成有用的东西,我可以使用什么算法或策略?

The output I'm looking for is something that can be cropped to give 我正在寻找的输出可以进行裁剪以提供 样本输出 .

An common practice is to use a gaussian blur . 一种常见的做法是使用高斯模糊 This will filter out the noise in the image depending on the intensity of the blur. 这将根据模糊的强度滤除图像中的噪点。 At the bottom of the article there is a gif with a cat image showing what you want. 在文章的底部,有一张gif图片,上面有一张猫图片,上面显示了您想要的东西。

After that there are contour finding algos which could help you extract the boundaries as pixel chains 之后,便有轮廓寻找算法,可以帮助您将边界提取为像素链

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM