I'm looking for a method which finds the ridges (local maxima) in an image and returns them as an array of ridges ( where a ridge is a vector of points defining the ridge). That is, a method which behaves exactly like findContours (which finds contours and returns them as an array of vectors defining the contours), except for ridges.
Does this exist, and if not how would I acheive this effect? (I'm using the Emgu CV wrapper for OpenCV)
I have this image (it's a bit faint, sorry), obtained using the distance transform from a binary image of a system of roads:
I can easily use findContours on the original binary image to get the road outlines as vectors of points. However I am interested in the road centerline. The road centerline is represented by the local maxima the image above.
Obviously, using findContours on this image gives me the road outlines again. I was planning to use non-maxima suppression to take away everything but the centerline, and use findContours on that, but I don't know how to do non-maxima suppression either, hence my question here