在MATLAB中填充没有imfill函数的二进制图像 [英] Fill the binary image without imfill function in MATLAB
本文介绍了在MATLAB中填充没有imfill函数的二进制图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于像这样的图像
有没有办法用白色填充这颗恒星的内部区域 imfill
功能?
Is there any way to fill the inner region of this star by white color without imfill
function?
推荐答案
我想你想要的是多边形填充。但是你必须对点和边进行排序,然后填充所有内容。
I guess what you want is Polygon Filling. But you have to sort the points and the edges, and then fill everything.
另一个更简单的解决方案是标记所有黑色组件(Union-Find算法),并且不要碰到边框的颜色。
An other simpler solution would be to label all the black components (Union-Find algorithm), and color the ones that do not touch the border.
这篇关于在MATLAB中填充没有imfill函数的二进制图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文