Canny's original paper addressed the issue of ridge edges and roof edges in addition to step edges, but I'm unaware of any implementation of "Canny" edge detection that detects anything other than step edges. Canny's paper is a pretty easy read, but, unfortunately, paywalled. J. Canny, "A computational approach to edge detection", IEEE Trans. Pattern Analysis and Machine Intelligence, 8:679-714, 1986.
Canny's paper is really about how to use calculus of variations to derive a 1-dimensional filter that has optimal response to each type of edge. It turns out that the ridge-edge filter is not scale invariant (you have to know how wide your ridges are). Here is the picture from Canny's paper of the optimal ridge and roof detection operators (page 683, © IEEE, 1986, this is "fair use"):
What is typically called "Canny edge detection" is as follows:
- Perform an approximation of a derivative of Gaussian function in X and Y. (This is usually done with a Gaussian blur followed by the Sobel operator.) (The derivative of Guassian is actually not the optimal step-edge detection operator, but the optimal step-edge detection operator "kinda-looks-like" a derivative of Gaussian.)
- Convert from $\langle\Delta x, \Delta y\rangle$ form at each pixel to $\langle$magnitude,"angle"$\rangle$. (Where "angle" is a 2-bit approximation that tells you whether the edge is closer to horizontal, vertical or one of the two 45-degree diagonals.)
- "Thinning": For each pixel look at its two neighbors in the "angle" direction and keep the pixel only if it is the maximum of itself and its two neighbors. (Otherwise set the magnitude to 0.)
- "Thresholding": For each pixel with magnitude less than some "weak threshold" suppress the pixel to 0. For each pixel with magnitude greater than some "strong threshold" set the pixel to whatever value means "definitely an edge." For pixels between the two thresholds set the pixel to the value "maybe an edge".
- Hysteresis: For each "maybe an edge" pixel change it to "definitely an edge" if any of its 8 neighbors in the horizontal, vertical or diagonal directions is "definitely an edge."
Theoretically, you should be able to turn a Canny edge detector into a ridge-edge detector by changing just step 1, but I've never tried it.