Thinning (morphology)

Thinning is the transformation of a digital image into a simplified, but topologically equivalent image. It is a type of topological skeleton, but computed using mathematical morphology operators.

Example
Let $$E=Z^2$$, and consider the eight composite structuring elements, composed by:


 * $$C_1=\{(0,0),(-1,-1),(0,-1),(1,-1)\}$$ and $$D_1=\{(-1,1),(0,1),(1,1)\}$$,
 * $$C_2=\{(-1,0),(0,0),(-1,-1),(0,-1)\}$$ and $$D_2=\{(0,1),(1,1),(1,0)\}$$

and the three rotations of each by $$90^o$$, $$180^o$$, and $$270^o$$. The corresponding composite structuring elements are denoted $$B_1,\ldots,B_8$$.

For any i between 1 and 8, and any binary image X, define
 * $$X\otimes B_i=X\setminus (X\odot B_i)$$,

where $$\setminus$$ denotes the set-theoretical difference and $$\odot$$ denotes the hit-or-miss transform.

The thinning of an image A is obtained by cyclically iterating until convergence:


 * $$A\otimes B_1\otimes B_2\otimes\ldots\otimes B_8\otimes B_1\otimes B_2\otimes\ldots$$.

Thickening
Thickening is the dual of thinning that is used to grow selected regions of foreground pixels. In most cases in image processing thickening is performed by thinning the background $$\text{thicken}(X, B_i) = X\cup (X\odot B_i)$$

where $$\cup$$ denotes the set-theoretical difference and $$\odot$$ denotes the hit-or-miss transform, and $$B_i$$ is the structural element and $$X$$ is the image being operated on.