sobel operator
This data is reviewed by the project of data compilation and application of Science Encyclopedia of science popularization in China.
Sobel operator is an important processing method in the field of computer vision. It is mainly used to obtain one step degree of digital image. The common application and physical meaning is edge detection. Sobel operator is to detect the edge by weighting the difference of the gray values of the four areas of each pixel in the image and reaching the extreme value at the edge.
Sobel operator is mainly used for edge detection. Technically, it is a discrete difference operator, which is used to calculate the approximate value of the gradient of the image luminance function. Using this operator at any point of the image will produce the corresponding gradient vector or its normal vector.
Sobel operator not only produces good detection effect, but also has smooth suppression effect on noise. However, the edge obtained by Sobel operator is coarse and may appear pseudo edge.
Operator description
Sobel operator is a common template in edge detection. There are two Sobel operators, one is to detect horizontal edge, the other is to detect vertical edge. Compared with Prewitt operator, Sobel operator can reduce the edge blur by weighting the position of pixels, so the effect is better.
Another form of Sobel operator is isotropic Sobel (isotropic Sobel) operator, there are two, one is to detect horizontal edge, the other is to detect vertical edge. Compared with Sobel operator, Sobel operator has more accurate edge detection in different directions. The isotropic Sobel matrix can be obtained by changing all 2 in Sobel operator matrix to root 2.
Because Sobel operator is the form of filter operator, it can be used to extract the edge by using fast convolution function, which is simple and effective, so it is widely used. The drawback is that Sobel operator does not strictly distinguish the main body of the image from the background. In other words, Sobel operator does not process the image based on the gray level. Because Sobel operator does not strictly simulate human visual physiological characteristics, the extracted image contour is sometimes not satisfactory. When we observe an image, we often pay attention to the part of the image that is different from the background. It is this part that highlights the main body. Based on this theory, we give the following thresholding contour extraction algorithm, which has been proved mathematically that the solution is optimal when the pixels meet the normal distribution.
computing method
The edge operator of Sobel operator adopts the algorithm of weighted average first and then differential operation
The vertical and horizontal templates of Sobel operator are shown in Figure 10-12. The former can detect the horizontal edge in the image, while the latter can detect the vertical edge in the image. In practical application, the maximum value of two template convolutions is taken as the output value of each pixel, and the result is an edge image.
Core formula
The operator consists of two groups of 3x3 matrices, which are transverse and longitudinal. By convoluting them with the image, the approximate values of transverse and longitudinal luminance differences can be obtained. If a is used to represent the original image, GX and Gy are used to represent the image after transverse and longitudinal edge detection respectively, the formula is as follows:
The approximate values of the horizontal and vertical gradients of each pixel of the image can be combined with the following formula to calculate the size of the gradient.
In the above example, if the above angle θ is equal to zero, it means that there is a longitudinal edge in the image, and the left side is darker than the right side.
Refine edges
In the research and application of image, people are often only interested in some parts of the image. These parts are usually called targets or prospects, and the rest are called backgrounds. The operation of dividing an image into targets and backgrounds is called image segmentation. Image segmentation is a key step from image processing to image analysis, So far, thousands of segmentation algorithms have been proposed. They can be roughly divided into threshold method, edge detection method and region growing method. Among these methods, people pay more attention to the threshold method, and new methods are proposed from time to time. However, the latter two methods pay less attention. The existing methods are basically proposed in the 1960s to 1970s, But its disadvantage is that the selection of threshold is mainly based on the histogram of gray distribution, and little consideration is given to the spatial relationship of pixels, The object and background can not be separated simply by a threshold. In this case, we have to resort to the edge detection method or region growing method. Sobel operator is the most commonly used edge detection method
Sobel operator has the advantages of simple method, fast processing speed, and smooth and continuous edges. Its disadvantage is that the edges are thick. Because of the need for binary processing, the edge obtained also has a great relationship with the selection of threshold value. The edge thinning method proposed in this paper is to obtain undistorted gray-scale edge image by introducing attenuation factor, and then refine it by Sobel operator, For the part with steep edge, smooth, continuous and close to the single point wide edge can be obtained; for the part with fuzzy edge, this process can be repeated many times, and thin edge (but not necessarily continuous) can be obtained. At the same time, this method can also keep the edge with low amplitude. In this way, the positioning accuracy can be improved, It can also get fuzzy edge and weak edge which are difficult to get by other methods, and it is also effective to deal with the edge which is obtained by other edge detection methods
The applications of edge thinning are as follows
(1) For the separation of overlapping objects, as shown in Figure 8 (a), the three cells in the binary image cannot be segmented, but the edge information needed for segmentation can be obtained from the refined edge graph (Figure 8 (b))
(2) For the filling of the defect object, there is a defect on the inner side of the vessel wall in the two value image in Fig. 8 (c), and the required edge information can be obtained from the refined edge image (Fig. 8 (d))
(3) For example, there is a small particle on the edge of cell and vessel wall
(4) Because the edge takes the gray difference as the separation parameter, and the edge line is thin, the positioning is more accurate, and the detection effect is better than the threshold method, which is conducive to the improvement of measurement accuracy
The disadvantage of this method is that the processing effect is related to the quality of the edge itself. If the quality of the edge is good and the dividing line is steep, the effect is better, otherwise it is poor, and it is not suitable for the ideal order
Chinese PinYin : Suo Bei Er
Sobel