Summary of common edge detection operators for image processing

Source: Internet
Author: User

Different image grayscale, the boundary will generally have an obvious edge, using this feature can be segmented image. It is necessary to note that the boundary between the edge and the object is not the same, the edge refers to the image of the value of the pixel has a mutation, and the boundary between objects refers to the real scene in the existence of the boundary between objects. There is a possibility that the edge of the place is not a boundary, there may be no edge of the place, because the real world objects are three-dimensional, and the image only has two-dimensional information, from three-dimensional to two-dimensional projection imaging will inevitably lose a part of the information, in addition, the imaging process of light and noise is an unavoidable important factor. For these reasons, edge-based image segmentation is still a world-class problem in current image research, and researchers are currently trying to add high-level semantic information to edge extraction.

In the actual image segmentation, the first and second derivative is often used only, although, in principle, higher-order derivative can be used, however, because of the effect of noise, in the pure second derivative operation there will be a noise sensitive phenomenon, the third-order derivative information often loses the application value. The second derivative can also describe the type of gray mutation. In some cases, such as gray-scale uniform image, only the first-order derivative may not find the boundary, the second derivative can provide very useful information. Second derivative is more sensitive to noise, and the solution is to filter the image first, eliminate some noise, and then detect the edge. However, the second derivative information algorithm is based on over 0 detection, so the number of edge points is relatively small, conducive to subsequent processing and identification work.

The existence of all kinds of operators is the instantiation calculation of this derivative division principle, which is a kind of calculating unit that is used directly in the calculation process.

1.Sobel operator

It is mainly used for edge detection, technically it is a discrete differential operator, used to calculate the approximate value of the gradient of the image luminance function, the Sobel operator is a typical edge detection operator based on the first derivative, because the operator introduces a similar local averaging operation, so the noise has a smooth effect, Can be very good to eliminate the impact of noise. The effect of Sobel operator on the position of pixels is weighted, which is better than Prewitt operator andRoberts operator.

The Sobel operator consists of two sets of 3x3 matrices, the horizontal and vertical templates, and the image as a plane convolution, respectively, to obtain the transverse and longitudinal luminance difference approximation. In practice, the following two templates are commonly used to detect the edges of an image.

Detection horizontal Edge Horizontal Template: Detect vertical flat-edge vertical Template:

The horizontal and vertical gradient approximation of each pixel of an image can be combined with the following formula to calculate the size of the gradient.

The gradient direction can then be calculated using the following formula.

In the above example, if the angle θ above is equal to zero, that means the image has a longitudinal edge and the left side is darker than the right.

The disadvantage is that the Sobel operator does not distinguish the subject and background of the image strictly, in other words, the Sobel operator is not processed based on the image grayscale, and because the Sobel operator does not strictly simulate human visual physiology, the extracted image contour is sometimes not satisfactory.

2. Isotropic Sobel operator

Another form of Sobel operator is (isotropic Sobel) operator, weighted average operator, the weight value is inversely proportional to the distance between the adjacent point and the center point, when the edge is detected in different directions, the gradient amplitude is the same, which is commonly said isotropic Sobel (isotropic Sobel) operator. There are also two templates, one for detecting horizontal edges and the other for detecting vertical flat edges. Compared with the ordinary Sobel operator, the isotropic Sobel operator has a more accurate position weighting coefficient, which is consistent in detecting the edges of different directions.

3. Roberts operator

Roberts operator, Roberts operator is one of the simplest operators, is a local difference operator to find the edge of the operator, he uses the diagonal direction of the difference of the adjacent two pixels near the gradient amplitude detection edge. The detection of vertical edge is better than oblique edge, high positioning precision, noise-sensitive, can not suppress the impact of noise. In 1963, Roberts proposed this operator for edge finding. The Roberts edge operator is a 2x2 template that uses the difference of two pixels adjacent to the diagonal direction. In view of the actual effect of image processing, the edge location is more accurate and the noise is sensitive. Suitable for image segmentation with obvious edges and less noise. Roberts Edge detection operator is a kind of operator that uses local difference operator to find edge, and the result edge of Robert operator image processing is not very smooth. It is analyzed that because the Robert operator usually produces a wide response in the area near the edge of the image, the edge image detected by the above operator is often refined and the precision of edge positioning is not very high.

4. Prewitt operator

Prewitt operator is the edge detection of a first order differential operator, which uses the gray difference of the top and left neighboring points of the pixel, achieves the extremum detection edge at the edge, removes some pseudo-edges, and has a smooth effect on the noise. Its principle is in the image space using two direction template and the image of the neighborhood convolution to complete, these two direction template a detection level edge, a detection vertical edge.

For the digital image f (x, y), the Prewitt operator is defined as follows:

G (i) =| [F (i-1,j-1) +f (i-1,j) +f (i-1,j+1)]-[f (i+1,j-1) +f (i+1,j) +f (i+1,j+1)]| G (j) =| [F (i-1,j+1) +f (i,j+1) +f (i+1,j+1)]-[f (i-1,j-1) +f (i,j-1) +f (i+1,j-1)]| P (i,j) =max[g (i), G (j)] or P (i,j) =g (i) +g (j) The classical Prewitt operator thinks that all pixels with a new gray value greater than or equal to the threshold are edge points. That is, select the appropriate threshold T, if P (i,j) ≥t, then (I,J) is the Edge point, p (i,j) is the edge image. This judgment is not reasonable, will cause the edge of the miscalculation, because many noise points of the gray value is also very large, and for the smaller amplitude of the edge point, the edge is lost.

The Prewitt operator has an inhibitory effect on noise, the principle of suppressing noise is through the average pixel, but the average pixel is equal to the low-pass filter of the image, so the Prewitt operator is inferior to the Roberts operator.

Because the average can reduce or eliminate the noise, the Prewitt gradient operator method is to seek the average first, then seek the difference to seek the gradient. The horizontal and vertical gradient templates are:

Detection horizontal edge Transverse template detection vertical flat edge portrait Template:

The operator is similar to the Sobel operator, but the weight value has changed, but there is still a gap between the two implementations, it is learned that Sobel is more accurate than Prewitt to detect the edge of the image.

5.Laplacian operator

Laplace operator is a kind of isotropic operator, second-order differential operator, it is appropriate to only care about the position of the edge without considering the difference of pixel gray value around it. The Laplace operator responds more strongly to the isolated pixels than to the edge or line, and is therefore only suitable for noise-free images. In the presence of noise, low-pass filtering is required before using the Laplacian operator to detect edges. Therefore, the usual segmentation algorithm is to combine the Laplacian operator and the smoothing operator to generate a new template.

The Laplace operator is also the simplest isotropic differential operator with rotational invariance. The Laplace transformation of a two-dimensional image function is an isotropic second-order derivative, which defines

More suitable for digital image processing, the pull operator is represented as a discrete form:

In addition, the Laplace operator can also be represented as a template form, as shown in

The template of the discrete Laplace operator:, its extension template:.

A pull operator is particularly effective for improving the blurring of diffusion effects because it conforms to the descending model. Diffusion effect is a frequent phenomenon in the process of imaging.

Laplacian operators are generally not used for edge detection in their original form, because as a second derivative, the Laplacian operator has unacceptable sensitivity to noise, and its amplitude is generated to calculate edges, which is a complex segmentation of unwanted results. The last Laplacian operator cannot detect the direction of the edge, so the role of Laplacian in the segmentation includes: (1) using its 0 cross-properties for edge positioning; (2) Determine whether a pixel is on a dark side or a bright side of an edge , generally using the Gaussian-type Laplace operator (Laplacian of a gaussian,log), because the second derivative is a linear operation, the use of a LoG convolution image with the first Gaussian-type smoothing function convolution to change the image, and then calculate the result of the Laplace is the same. So the purpose of using the Gaussian function in the log formula is to smooth the image, using the Laplacian operator to provide an image with a 0 cross to determine the edge position. Image smoothing reduces the effect of noise and its main function is to counteract the increasing noise effects caused by the second derivative of the Laplacian operator.

6.Canny operator

The operator is better than the previous several, but it is cumbersome to implement, the canny operator is a multi-stage optimization operator with filtering, enhancement, detection, before processing, the canny operator first uses the Gaussian smoothing filter to smooth the image to remove the noise, Canny segmentation algorithm uses the finite difference of the first order bias to calculate the gradient amplitude and direction, in the process of processing, the canny operator will also undergo a non-maximal value suppression process, and finally the canny operator uses two thresholds to connect the edge.

Canny Edge detection algorithm

Step1: Smoothing the image with Gaussian filter;

Step2: The amplitude and direction of the gradient are calculated by using the finite difference of first order bias;

Step3: Non-maximum suppression of gradient amplitude values

STEP4: Detecting and connecting edges with a dual-threshold algorithm

Explanation: http://www.cnblogs.com/cfantaisie/archive/2011/06/05/2073168.html

(1) Image edge detection must meet two conditions: one can effectively suppress noise, and the second must be as precise as possible to determine the position of the edge.

(2) The optimal approximation operator is obtained based on the measurement of SNR and the product of positioning. This is the canny edge detection operator.

(3) similar to the Marr (LoG) edge detection method, also belongs to the first smoothing after the derivative number method.

Summary of common edge detection operators for image processing (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.