edge detection
The ideal case for edge will have a deep change, and the 1st derivation can be used for detecting purpose with looking for big absolute values, but in real word, ramp edges exist, well, the 2nd derivation produce a sign change, which can also be used for edge detection, shown as below.
However, it is not perfect in real world, some noise makes the trouble, the derivation operations on the contray amplify the noise.
So, usually, smothing is applied first before edge detection. Some edge detector(fileter) is designed to integrate the smothing element.
Edge detection is fundamental related to the gradient of the image. That is,
The magnitude and orientation of pixel
We can do things like,
The second equation can get the line of
Here briefly introduce three types edge detector(filter)s: sobel filter, LoG detector, canny detector.
1. Sobel filter
2. LoG detector(Laplacian of Gaussian)
The sobel filter has only one set of scale, by contrast, LoG can be tuned to detecting different scale of edges, LoG has the form as,
The negative of LoG has the shape like this, and the
In LoG, 1) The Gaussian smooths the image down to a certain scale; 2) Laplacian finds edges at that scale; 3) LoG will look for zero-crossing of LoG operation since it is like a 2nd derivative. In matlab, function “fspecial” with “log” parameter works for it.
We can approximate the LoG with a difference of Gaussians(DoG), which is used a lot in computer vision(like SIFT)
3. canny detector
The basic steps of canny detector include:
1) Smooth image with a Gaussian;
2) Compute
3) Apply non-maxima suppression to
the basic idea is to quantize
4) Detect and link edges
respectively for strong and weak edges detection.
and the final map is
The canny edge detector usually has the cleaner result.
All three types edge detector can be realized with function “edge” in matlab.