中轴变换实现

发布于 2024-12-01 01:32:01 字数 855 浏览 1 评论 0原文

如何实现 Medial Axis Transform 算法来转换第一个图像进入第二个?

thinning-L.gif
(来源:算法位于 www.cs.sunysb.edu )

thinning-R.gif
(来源:
算法位于 www.cs.sunysb.edu )

C++/C# 中的哪些库支持中轴变换?

How do I implement the Medial Axis Transform algorithm to transform the first image into the second?

thinning-L.gif
(source: algorith at www.cs.sunysb.edu)

thinning-R.gif
(source: algorith at www.cs.sunysb.edu)

What library in C++/C# have support for Medial Axis Transform?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昔日梦未散 2024-12-08 01:32:01

互联网上有很多中轴变换的实现(我个人不使用 OpenCV 库,但是我确信它有一个不错的实现)。但是,您可以轻松地自己实现它。

为了进行中轴变换,我们只需要定义一个术语:简单点。
点 (P) 是简单点,当且仅当删除 P 不会影响前景或背景的连通分量的数量。因此,您必须决定背景和前景的连接(4或8) -为了工作,为两者选择不同的一个(如果您有兴趣为什么,请在谷歌上查找乔丹财产)。

简单点和非简单点的示例

中间变换轴可以通过顺序删除简单点来实现。如果没有更多的简单点,你就得到了最终的骨架。如果你只有端点或非简单点,你会得到弯曲的骨架(我不知道它的英文名称,这是罕见的 - 请纠正我)。您在问题中提供了后者的示例。

使用形态运算符可以轻松实现查找简单点一个查找表。提示:一个点是简单点,当且仅当在 3x3 本地窗口中,背景中的连通分量的数量为 1,并且前景中的连通分量的数量为 1。

There are many implementations of the medial axis transform on the Internet (personally I don't use OpenCV library but I'm sure it has a decent implementation). However, you could easily implement it yourself.

In order to perform medial axis transform, we need to define only one term: simple point.
A point (P) is simple point iff removing P doesn't effect the number of connected components of either the foreground or the background. So, you have to decide the connectivity (4 or 8) for the background and for the foreground - in order to work pick different one for both (if you are interested why, look up Jordan property on google).

Examples for simple and non-simple points

Medial transform axis could be implemented by sequentally deleting simple points. You get the final skeleton if there are no more simple points. You get the curved skeleton (I don't know the english name for it which is rare - please correct me) if you only have endpoints OR non-simple points. You provided examples of the latter in your question.

Finding simple points could be easily implemented with morphological operators or a look-up table. Hint: a point is simple point iff the number of connected components in the background is 1 and the number of connected components in the foreground is 1 in a 3x3 local window.

尾戒 2024-12-08 01:32:01

此 C 库中有一个中轴变换可用:http://www.pinkhq.com/
还有很多其他相关功能。
查看此功能:http://www.pinkhq.com/medialaxis_8c.html

There is a medial axis transform available in this C Library:http://www.pinkhq.com/
There are lot other related functionalities.
Check out this Function:http://www.pinkhq.com/medialaxis_8c.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文