'**SUMMARY**
Skeletonization is the process of taking in a set of blobs (here blobs are white
on a black background) and finding a squigly line that would be the back bone of
the blobs were they some sort of vertebrate animal. Another way of thinking about
skeletonization is that it finds a series of lines that approximates a blob\'s shape.
A good summary can be found here:
http://www.inf.u-szeged.hu/~palagyi/skel/skel.html
**PARAMETERS**
* *radius* - an intenger that defines how roughly how wide a blob must be to be added
to the skeleton, lower values give more skeleton lines, higher values give
fewer skeleton lines.
**EXAMPLE**
>>> cam = Camera()
>>> while True:
>>>     img = cam.getImage()
>>>     b = img.binarize().invert()
>>>     s = img.skeletonize()
>>>     r = b-s
>>>     r.show()
**NOTES**
This code was a suggested improvement by Alex Wiltchko, check out his awesome blog here:
http://alexbw.posterous.com/'

def skeletonize(self, radius=5):

    img = self.toGray().getNumpy()[:, :, 0]
    distance_img = ndimage.distance_transform_edt(img)
    morph_laplace_img = ndimage.morphological_laplace(distance_img, (radius, radius))
    skeleton = (morph_laplace_img < (morph_laplace_img.min() / 2))
    retVal = np.zeros([self.width, self.height])
    retVal[skeleton] = 255
    return Image(retVal)
