Local maxima of an image

Hi everyone....
I'm trying to develop the skeleton of few basic shapes from their
binary image... for this i'm using their distance transform to compute
the skeleton. accordingly i have to obtain the local maxima to get the
skelton... how can i obtain the local maxima of the distance transform
which will be a gray scale image...