Afast parallel algorithm for thinning digitalpatterns” byT.Y. Zhang and C.Y. Suen.以及Parallelthinning with two sub-iteration algorithms” byZicheng Guo and Richard Hall
Zhangand C.Y. Suen的图像骨架提取算法可以得到比较平滑的边界。具体的算法如下:
定义,B(P1)为p1点的非零邻域的个数,A(P1)为p1点周围8个像素点灰度值以0-1顺序排列的个数(一部分国内教材没介绍A(P1)的具体含义,导致看不懂原理),如上图所示。之后,进行对每个像素点如下图所示操作:
Zhang-Suen thinning steps:
- While points aredeleted do
- Forall pixels p(i,j) do
- if (a)2 ≤ B(P1) ≤6
(b) A(P1) =1
(c) Applyone of the following:
1. P2 xP4 xP6 =0 in odd iterations
2. P2 xP4 xP8 =0 in even iterations
(d) Applyone of the following:
1. P4 xP6 xP8 =0 in odd iterations
2. P2 xP6 xP8 =0 in even iterations
then - Deletepixel p(i,j)
- end if
- end for
- end while
Where A(P1) isthe number of 0 to 1 transitions in a clockwise directionfrom P9 backto itself, and B(P1) isthe number of non-zero neighbors of P1.