Sobel Edge Detection algorithm

Source: Internet
Author: User

Sobel Edge Detection algorithm

Reprint Please specify source: http://blog.csdn.net/tianhai110

The Bell operator (Sobel operator) is mainly used for edge detection, and technically, it is a discrete difference operator, which is used to calculate the approximate value of the grayscale of the image luminance function. Using this operator at any point in the image will produce a corresponding grayscale vector or its normal vector

The Sobel convolution factor is:

The operator consists of two sets of 3x3 matrices, which are transverse and longitudinal, and the horizontal and vertical luminance difference approximation can be obtained by the plane convolution with the image respectively. If the original image is represented by a, the GX and Gy represent the gray values of the image measured by transverse and longitudinal edges respectively, and the formula is as follows:

The calculation is as follows:

Gx = ( -1) *f (x-1, y-1) + 0*f (x,y-1) + 1*f (x+1,y-1)

+ ( -2) *f (x-1,y) + 0*f (x, y) +2*f (x+1,y)

+ ( -1) *f (x-1,y+1) + 0*f (x,y+1) + 1*f (x+1,y+1)

= [F (x+1,y-1) +2*f (x+1,y) +f (x+1,y+1)]-[f (x-1,y-1) +2*f (x-1,y) +f (x-1,y+1)]

Gy =1* F (x-1, y-1) + 2*f (x,y-1) + 1*f (x+1,y-1)

+0*f (x-1,y) 0*f (x, y) + 0*f (x+1,y)

+ ( -1) *f (x-1,y+1) + ( -2) *f (x,y+1) + ( -1) *f (x+1, y+1)

= [F (x-1,y-1) + 2f (x,y-1) + f (x+1,y-1)]-[f (x-1, y+1) + 2*f (x,y+1) +f (x+1,y+1)]

where F (A, B), indicating the gray value of the image (A, b) point;

The horizontal and vertical gray values of each pixel of the image are combined with the following formula to calculate the gray size of the point:

In general, in order to increase efficiency, use an approximate value of not open squares:

if the gradient g greater than a certain threshold It is considered that the point (x, y) as the edge point.

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

The Sobel operator detects the edge by reaching the extremum at the edge, according to the Gray weighted difference between the upper and lower points of the pixel and the left and right neighbors. It has smooth effect on noise, provides accurate edge orientation information and low edge positioning accuracy. When the accuracy requirement is not very high, it is a more common method of edge detection.
  

Incidental knowledge:

Prewitt operator (Prewitt operate) :

In addition to Sobel edge detection, there are Prewitt operators, and its convolution factor is as follows:

Other calculations are similar to Sobel;

The Prewitt operator uses the gray difference between the upper and lower points of the pixel point and the left and right neighbors to achieve the extremum detection edge. The noise has a smooth effect and the positioning accuracy is not high enough.

Roberts Cross Edge Detection (Roberts crosses operator )

The convolution factor is as follows:

The grayscale formula is:

The approximate formula is:

The calculation is as follows:

G (x, y) =abs (f (x, Y)-f (x+1,y+1)) +abs (f (x,y+1)-F (x+1,y))

The calculation formula for the gray direction is:

The Roberts operator uses an approximate gradient amplitude to detect the edge of the adjacent two-pixel difference in the diagonal direction. Detection of horizontal and vertical edges is better than oblique edges, high positioning accuracy, noise-sensitive

Other Edge Detection technologies:

Reference article:

Http://homepages.inf.ed.ac.uk/rbf/HIPR2/featops.htm

Http://homepages.inf.ed.ac.uk/rbf/HIPR2/sobel.htm

Sobel Edge Detection algorithm

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.