medial axis transform implementation

匿名 (未验证) 提交于 2019-12-03 08:52:47

问题:

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

thinning-L.gif http://www.cs.sunysb.edu/~algorith/files/thinning-L.gif thinning-R.gif http://www.cs.sunysb.edu/~algorith/files/thinning-R.gif

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

回答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).

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.



回答2:

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



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!