Image processing - Zhang-Suen Thinning
Introduction The next step is to implement the thinning algorithm, where we use the zhang-suen thinning algorithm. This method aims to remove all the points until becoming a single line (skeleton). The algoritmh check all colored points (will call black), then see if the neighbor’s black and white is under some condition, if the condition mets the black point would be removed (that is become white). Implementation CountNonZero8 (result as A) count how many 1’s in the 8 neighbors. Transitions01 (results as B) count how many 0 to 1 for 8 neighbors. Two pass checking (slightly differnet) A should be 2~6 B should be 1 p2 or p4 or p6 should be 0 (p2, p4, p8 in second pass) p4 or p6 or p8 should be 0 (p2, p6, p8 in second pass) denoting as: ...