The skeleton/MAT can be produced in two main ways.
The first is to use some kind of morphological thinning that successively erodes away pixels from the boundary (while preserving the end points of line segments) until no more thinning is possible, at which point what is left approximates the skeleton.
The alternative method is to first calculate the distance transform of the image. The skeleton then lies along the singularities (i.e. creases or curvature discontinuities) in the distance transform. This latter approach is more suited to calculating the MAT since the MAT is the same as the distance transform but with all points off the skeleton suppressed to zero.
OpenCV没有一个骨架函数,但是您可以创建自己的函数。来自here:
Here您可以找到一个使用形态操作的示例:
相关问题 更多 >
编程相关推荐