这种效果叫什么?如何使用 Matlab 实现它?
我正在尝试从 MATLAB 中的基本形状生成以下“效果”:
但我什至不知道这个过程是如何调用的。假设我有一个包含棕色形状的图像,我想要的是生成它外部的轮廓,随着它们变大,轮廓会变得更平滑。
是否有此效果的名称、在 MATLAB 中执行此操作的函数或从头开始执行此操作的算法?
谢谢
I am trying to generate the following "effect" from a basic shape in MATLAB:
But I don't even know how this process is called. Let's say I have an image containing the brown shape, what I want is generate the contours outside of it, that get smoother as they get bigger.
Is there either a name for this effect, a function to do this in MATLAB or an algorithm that does it from scratch?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您正在寻找
bwdist
。您显示的图像看起来像是距形状边界的距离函数的正部分。您可以使用 上述手册页。
I think you are looking for
bwdist
.The image you are displaying looks like the positive part of a distance function from the boundary of your shape. You can perform this easily in Matlab using the examples on the aforementioned manual page.
试试这个:
需要图像处理工具箱,但基本思想是使用相差 1 的膨胀元素(或者无论您希望轮廓有多粗)将图像膨胀两次,然后从较大的元素中减去较小的元素的结果。然后你可以为它们涂上你想要的颜色。
Try this:
Requires image processing toolbox, but the basic idea is to dilate the image twice with dilation elements that differ by 1 (or however thick you want the contours to be) and subtract the result of the smaller one from the bigger one. You could then color them however you want.