Diving more into Edge detection

If you have not read my previous blog then kindly read it at this blog, as it will be a lot helpful to understand this blog :)

In the previous blog, I have talked about prewitt and sobel edge detection methods, so lets move on to others.

Marr hildreth edge detector

First we smooth the image by convolving the image with a gaussian filter and then calculate the laplacian (second derivative) of it. An interesting property is that you can take the laplacian of the gaussian filter and then convolve it with the image as WhatsApp Image 2022-07-03 at 3.10.57 PM.jpeg Then we find zero crossings. To mark an edge we compute the slope of the zero-crossing and then apply a threshold to slope.

But if you see convolution will require n^2 multiplications, which we can reduce by using one of the properties of laplacian of gaussian (separability) as follows: I is image, g is gaussian filter

image.jpeg

Example:

WhatsApp Image 2022-07-09 at 12.23.50 PM.jpeg

Canny Edge detector

Thoughts which were into this edge detection were like :

  • Good detection: The optimal detector should minimize the probability of false positives as were as false negatives.
  • Good localization: The edges detected must bd as close as possible to the the true edges.
  • Single Response Constraint: The detector must return one point only for each edge point.

Steps involved:

  • Smooth image with the gaussian filter
  • Compute derivative of filtered image
  • Find magnitude and orientation of gradient
  • Apply “non maximum suppression” Suppress (assign 0 value) to the gradient values which are not maximum in the direction of the gradient
  • Apply “Hysteresis Threshold” If the gradient at a pixel is
  • above “High”, declare it as an ‘edge pixel’
  • below “Low”, declare it as a “non-edge-pixel”
  • between “Low” and “High” Consider its neighbours iteratively then declare it an “edge pixel” if it is connected to an ‘edge pixel’ directly or via pixels between “low” and “high”

In the upcoming blogs I will be writing about Interest Point detection, SIFT, Optical Flow etc so stay tuned.

Did you find this article valuable?

Support Himanshu Maurya by becoming a sponsor. Any amount is appreciated!