Applies binary thinning operators to the input image. Thinning discards most of objects foreground
(value one) pixels and leaves behind a "skinny" object which still mostly describes the original object's shape.
This implementation is known as the morphological thinning. It works by applying 8 masks to the image sequence.
When a mask is applied pixels which need to be set to zero are recorded in a list. After the mask as been
applied the pixels are modified, then the next mask is applied. This cycle is repeated until the image
no longer changes.
Based off the description in [1] using masks from [2]. The masks in those two sources are very similar but
there is a one pixel difference which appears to create a smoother image in a couple of test cases.
- Rafael C. Gonzalez and Richard E. Woods, "Digital Image Processing" 2nd Ed. 2001.
- http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm, October 31, 2015