The implementation of the transformation of the median axis

How to implement the Medial Axis Transform algorithm to convert the first image to 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

In which C ++ / C # library is there support for converting the medial axis?

+4
source share
2 answers

There are many implementations of converting the medial axis on the Internet (I personally do not use OpenCV , but I'm sure it has a decent implementation). However, you can easily implement it yourself.

To perform the transformation of the medial axis, we need to define only one term: a simple point. Point (P) is a simple point if removing P does not affect the number of connected components in either the foreground or the background. So, you have to solve connectivity (4 or 8) for the background and for the foreground - to work, select the other for both (if you're interested, look at the Jordan property on google).

Examples for simple and non-simple points

The axis of the medial transformation can be implemented by sequentially deleting simple points. You get the last skeleton if there are no simpler points. You get a curved skeleton (I don’t know which English name is rare for it, please correct me) if you have only endpoints or difficult points. You have provided examples of the latter in your question.

The search for simple points can be easily implemented using morphological operators or a lookup table. Hint: dot is a simple dot if the number of connected components in the background is 1 and the number of connected components in the foreground is 1 in the local 3x3 window.

+5
source

This C library has a medial axis transformation: http://www.pinkhq.com/ There are many other related functions. Check out this feature: http://www.pinkhq.com/medialaxis_8c.html

0
source

All Articles