Muthukrishnan R, Radha M. - Edge detection algorithms for image segmentation. Image Processing and Recognition in Preventive Security Systems: A Tutorial

Nonlinear edge detection systems use nonlinear combinations of pixel brightness values ​​to contrast before the threshold. Most of the methods are limited to processing a window of size or.

Roberts proposed the following simple nonlinear operation of two-dimensional discrete differentiation for contrasting and highlighting differences:

.(17.4.10)

Another operation of spatial differentiation, which requires less computation, is determined by the formula

It can be easily shown that

By marking the one of the four image elements located near the detected point, which has the highest brightness value, it is possible to obtain information about the approximate orientation of the drop. Rice. 17.4.8 illustrates how the Roberts operators work.


Rice. 17.4.8. Examples of edge detection using Roberts detectors.

Sobel suggested using a nonlinear operator with a window of elements for contrasting. In fig. 17.4.9 shows the designations of the window elements used by him. To contrast the differences, the value is calculated

, (17.4.13а)

The values ​​are the brightness of the elements of the window shown in Fig. 17.4.9. The results of detecting drops using the Sobel operator are shown in Fig. 17.4.10.

Another nonlinear operator with the same window of elements for contrasting the differences was proposed by Kirsch.

Rice. 17.4.9. Designation of elements for operators of selection of edges with a window size.

This operator is defined by the following expression:

, (17.4.14а)

, (17.4.14b)

The indices of the addends are calculated modulo 8. In essence, the Kirsch operator gives the maximum value of the heading gradient at some point in the image without taking into account the value. Examples of detecting drops using the Kirsch operator are shown in Fig. 17.4.11.

Wallis proposed a non-linear edge detection method based on homomorphic image processing. According to this method, a point is on the difference if the value of the logarithm of the brightness at this point exceeds the average value of the logarithms of the brightness of the four nearest neighboring elements by some fixed value. The contrasting element is defined as

or equivalently

... (17.4.15b)

Comparison with the upper and lower thresholds is equivalent to comparing the fraction in parentheses of expression (17.4.156) with the modified threshold. Therefore, it is not required to accurately calculate the values ​​of the logarithms. The main advantage of the logarithmic edge detector, besides the simplicity of calculations, is that it is not sensitive to multiplicative changes in the brightness level. Rice. 17.4.12 illustrates the operation of the logarithmic edge detector.

Rice. 17.4.10. Examples of extracting differences using the Sobel operator.

Rice. 17.4.11. Examples of extracting differences using the Kirsch operator.

The logarithmic contrasting method, defined by expression (17.4.15), can be considered as linear contrasting using the Laplace operator (17.4.5а) of the image, the levels of the elements of which are equal to the logarithms of the brightness. Other contrasting methods can also be easily represented as a sequence of nonlinear element-by-element operations with further linear contrasting of the drops and threshold limitation.

Rice. 17.4.12. Examples of extracting drops using the logarithmic Laplace operator.

Rosenfeld developed a non-linear method for increasing contrast and highlighting differences, based on calculating the product of a set of certain quantities. This method uses the one-dimensional row-by-row averaging operator. Current average

where and is an integer, calculated for each element of the image. This operation is performed for up to some desired upper limit. Then, for each element of the image, the product is calculated

It is clear that the factors corresponding to the higher order averaging indicate rather wide limits of the drop localization and produce some noise suppression, while the lower order averaging factors localize the drop more accurately, but the masks are much more sensitive to noise. At the same time, it can be assumed that the product of means of different orders should provide reliable detection and localization of true drops. Rosenfeld's justification for this assumption is as follows.

Rice. 17.4.13. Examples of the usual threshold restriction and the restriction with suppression by dominant neighbors for the case of the Sobel operator: a - the usual threshold restriction; b - enlarged area of ​​the image a, containing the barrel of the gun; d - the same area with a suppression coefficient equal to 1.5; d - the same section with a suppression coefficient equal to 1.2.

The magnitude tends to detect and accurately localize major drops while suppressing noise. This can be explained by the fact that the product is large only when all the factors are large, and as one moves away from the point of difference, the factors with small indices first decrease, and then with large ones.

In addition, Rosenfeld proposed a nonlinear thresholding procedure to isolate large, distinct drops that are surrounded by smaller ones. This procedure, which in what follows we will call "suppression by dominant neighbors", is performed by scanning the field of contrasting drops with a small window. The value in the center of the window is suppressed (set to zero) whenever it is not the largest of all the samples in that window. The normal threshold is then executed. Another option for such processing is that suppression is allowed only if there are elements in the window, the values ​​of which are much higher than the values. The Dominant Neighbor Suppression algorithm, followed by a thresholding, is quite effective in detecting edges when combined with a contrasting technique that provides some noise smoothing. In fig. 17.4.13 examples are given to illustrate the operation of the algorithm for suppression by dominant neighbors with subsequent threshold limitation.

Kirsch compass masks are yet another type of derivative mask which are used for edge detection. This operator is also known as direction mask. In this operator we take one mask and rotate it in all the eight compass directions to get edges of the eight directions.

We are going to use Opencv function filter2D to apply Kirsch operator to images. It can be found under Imgproc package. Its syntax is given below -

Filter2D (src, dst, depth, kernel, anchor, delta, BORDER_DEFAULT);

The function arguments are described below -

Sr.No. Argument
1

It is source image.

2

It is destination image.

3

It is the depth of dst. A negative value (such as -1) indicates that the depth is the same as the source.

4

It is the kernel to be scanned through the image.

5

It is the position of the anchor relative to its kernel. The location Point (-1, -1) indicates the center by default.

6

It is a value to be added to each pixel during the convolution. By default it is 0.

7

BORDER_DEFAULT

We let this value by default.

Apart from the filter2D () method, there are other methods provided by the Imgproc class. They are described briefly -

Sr.No. Method & Description
1

cvtColor (Mat src, Mat dst, int code, int dstCn)

It converts an image from one color space to another.

2

dilate (Mat src, Mat dst, Mat kernel)

It dilates an image by using a specific structuring element.

3

equalizeHist (Mat src, Mat dst)

It equalizes the histogram of a grayscale image.

4

filter2D (Mat src, Mat dst, int depth, Mat kernel, Point anchor, double delta)

It convolves an image with the kernel.

5

GaussianBlur (Mat src, Mat dst, Size ksize, double sigmaX)

It blurs an image using a Gaussian filter.

6

integral (Mat src, Mat sum)

It calculates the integral of an image.

Example

The following example demonstrates the use of Imgproc class to apply Kirsch operator to an image of Grayscale.

Import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.highgui.Highgui; import org.opencv.imgproc.Imgproc; public class convolution (public static void main (String args) (try (int kernelSize = 9; System.loadLibrary (Core.NATIVE_LIBRARY_NAME); Mat source = Highgui.imread ("grayscale.jpg", Highgui.CV_LOAD_IMAGE_GRAYSCALE); Mat destination = new Mat (source.rows (), source.cols (), source.type ()); Mat kernel = new Mat (kernelSize, kernelSize, CvType.CV_32F) ((put (0,0, -3); put ( 0,1, -3); put (0,2, -3); put (1,0-3); put (1,1,0); put (1,2, -3); put (2, 0,5); put (2,1,5); put (2,2,5);)); Imgproc.filter2D (source, destination, -1, kernel); Highgui.imwrite ("output.jpg", destination);) catch (Exception e) (System.out.println ("Error:" + e.getMessage ());)))

UDC: 004.932.72CH GRNTI: 28.23.15 DOI: 10.15643 / jscientia.2016.6.195

OPTIMAL ALGORITHMS FOR DETERMINING THE OUTLINES OF THE IMAGE IN THE SYSTEM OF TECHNICAL VISION

E. E. Pelevin *, S. V. Balyasny

Tula State University Russia, 300012, Tula, Lenin Ave., 92 * email: [email protected]

The article deals with the issue of image contour recognition in robotics. The objects of research are four contour identification algorithms: Kirsch, Robinson, Canny and Marr-Hildreth. With the help of these algorithms, which are often used in modern robotics, a study was carried out on the efficiency of image edge detection in systems technical vision with host at the entrance different types objects. The results of the research have shown that the Canny method is the most effective in highlighting the contours in the image. During the work, it was revealed that this method allows you to achieve high sharpness, as well as detail. The Marr-Hildreth method became the second most efficient in the selection of linear contours. Based on the results of the study, we can conclude that there are the most universal algorithms, but each of them is suitable for certain classes of images in its own way.

Keywords: Kirsch, Robinson, Canny, Marr-Hildreth, operator, recognition, contour, robotics, vision system (CTZ).

OPTIMAL ALGORITHM OF EDGE DETECTION WITHIN THE SYSTEM OF COMPUTER VISION

E. E. Pelevin *, S. V. Balyasny

Tula State University

Prospect Lenina 92, 300012, Tula, Russia

* email: [email protected]

The article touches upon the edge detection of digital images in robotics. Four algorithms of edge identification singled out by Kirsh, Robinson, Canny and Marr-Hildreth serve as the subject matter of the research. With the help of these algorithms widely used in the modern robotics, the research of efficiency of edge detection of images within the systems of computer vision which accept various input types of objects has been done. The results of the research done have shown that the method of Canny is the most effective in edge detection of images. During the work process, it has been found out that this method allows achieving both high definition and refinement. The method of Marr-Hildreth has become the second efficient method in edging of line contours. Based on the research results, the following conclusion can be drawn: there are more universal algorithms, but each of them differently fits particular classes of images.

Keywords: Kirsh, Robinson, Canny, Marr-Hildreth, operator, edge detection, contour, robotics, computer vision system.

Undoubtedly in the century computer technology more and more place in modern science takes robotics. This is due to the introduction of new equipment at factories, gas stations, airports and other spheres of human activity. Part of these newly introduced systems is a program with one or another algorithm for recognizing the contours of images, for example, the implementation of the selection of the contours of various parts or mechanisms. The entire subsequent operation of the robotic system as a whole depends on the effectiveness of this algorithm.

Currently, there are a large number of different algorithms for the selection of contours, but only a few of them are widespread, namely due to their versatility. In this paper, the most popular algorithms will be considered: the Kirsch operator, the Robinson operator, the Canny boundary detector, and the Marr-Hildreth method. A test image will be used to test these methods (Figure 1).

The first of the considered methods is the Kirsch operator. This method was developed by Russell A. Kirsch in 1971. This algorithm is based on the use of a detection matrix (mask), which is sequentially rotated along eight main sides.

Rice. 1. Source image for edge detection.

lights: north, northwest, west, southwest, south, southeast, east and northeast. After research, Russell A. Kirsch derived the following masks for each cardinal point:

5 5 5 -3 0 -3 -3 -3 -3J

COMPUTER SCIENCE | Juvenis scientia 2016 No. 6

In this case, the value of the border is defined as the maximum value that can be found using the mask. A specific mask helps the direction to give out the maximum value. From this we can conclude that the ko mask allows you to select vertical borders, and the k5 mask - diagonal ones. It is also noticeable from the masks that the latter are similar to the first four, but they are mirror image along the central axis of the used matrix.

During the processing of the test image, you can get the following result (Fig. 2).

Rice. 2. Identification of contours by the Kirsch operator.

Later in 1977, the Robinson operator was developed, which, in fact, was an analogue of the Kirsch method, but due to the use of the coefficients o, 1 and 2, it became easier to implement. Matrices used this operator, are symmetrical about their central axes, each of which is filled with zeros. Due to this, only the first four matrices can be used, and the rest of the results can be obtained by inverting the first. The Robinson operator will look like this:

Rice. 3. The result of the work of the Robinson operator.

Despite the simplicity of the previous operator, the Canny boundary detector ultimately gained the greatest popularity. The method was first described in 1983 by scientist John Canney in his master's thesis. This method surpasses many modern ones in efficiency of its work, even if it was developed more than thirty years ago. His distinctive feature is the elimination of noise on the contours of the image, which undoubtedly affects the final result. This algorithm consists in performing the following steps:

Blur the original image c) using the Gauss method ^ (r, c). ^ (r, c) = f (r, c) * G (r, c, 6);

Search for a gradient. Borders are outlined where the gradient is at its maximum;

Suppression of non-maxima. Only local highs are marked as boundaries;

The resulting boundaries are determined by suppressing all edges that are not bound to a specific boundary.

The result of the algorithm's work is the contours in the image. Due to its peculiarities, this method is not very sensitive to noise (Fig. 4).

It follows from the matrices that after each of them is successively applied to a pixel and its surroundings, the maximum value that it will receive will be considered the magnitude of the gradient. Then the angle of the gradient can be approximated as the angle of the line filled with zeros in the mask giving the maximum response.

As in the previous case, you can process the original images (Fig. 3).

Rice. 4. The result of the Canny method.

The latest border detection method digital images called Magg-Nure ^, which was developed in 1980. It implies the detection of curves in all areas where there is a sharp change in the brightness of pixel groups. This method is simple and works by convolving the original image

with LoG function or as fast approximation with DoG. In the method, the zeros in the reverse result indicate the contours of the image. For the method to work, you must adhere to the following steps of the algorithm:

Blur the image using the Gaussian method;

Application of the Laplace operator to blurry image(often the first two steps are combined into one);

A cycle of calculations is performed and in the result they look at the sign change. If the sign changes from negative to positive and the value changes by more than some predetermined threshold, then it is necessary to define this point as a border;

For best results, a step using the Laplace operator can be performed through hysteresis, that is, as implemented in the Canny algorithm.

The result of the operation of this algorithm on the test image will be as follows (Fig. 5).

Based on the studies carried out, we can conclude that the Canny method, which allows you to achieve the greatest sharpness of boundaries and high detail, can be most effectively used in robotics to recognize mechanisms and other objects consisting of curved contours. For the selection of linear contours of objects, for example, in cases where vision systems are used on conveyor lines, the Marr-Hildreth method is best suited, which highlights even small linear contours in images. Thus, in robotics, all the described selection algorithms can be used, but each of them is most effective for a certain class of problems, and is also aimed at obtaining a result of a certain quality.

LITERATURE

1. Ammeral L. Principles of programming in computer graphics / L. Ammeral. M .: Sol System, 1992.665 p.

2. Butakov E.A. Computer image processing: monograph. / E.A. Butakov, V.I. Ostrovsky, I.L. Fadeev. M .: Radio and communication, 1987.205 p.

3. Pratt W. Digital image processing / W. Pratt. Moscow: Mir, 1982.Vol. 2.716 p.

4. Tu J. Principles of pattern recognition / J. Tu, R. Gonzalez. Moscow: Mir, 1978.764 p.

5. Fine V.S. Image recognition / V.S. Fine. Moscow: Nauka, 2003.322 p.

6. Yanshin V. Image processing in C for IBM PC: Algorithms and programs / V. Yanshin, G. Kalinin. Moscow: Mir, 1994.358 p.

For discrete images, the calculation of partial derivatives is reduced to calculating the difference in brightness of neighboring pixels by various methods, i.e., in fact, to spatial filtering. For example, a Roberts filter that uses the minimum number of pixels to determine the brightness gradient can be represented as f 11 (x, y) 2 | , where b is the weighting factor; L is the transformation by the Laplace operator; in this case, it is necessary to take into account the sign of the brightness of the peak after the transformation. As a result, the brightness of pixels lying at the beginning of the transition from a less bright area to a brighter one will decrease, since the result of the Laplace transform for these pixels will be greater than zero. The brightness of the pixels at the end of this transition, respectively, will increase, since for them the result of the Laplace transform will be less than zero. As a result, the sharpness of this transition will increase, which is demonstrated in Fig. 6.7 for b = 1. By changing the value of b and choosing different masks for the Laplace operator from (6.3), it is possible to adjust the degree of underlining the contour. The second approach can be represented as f 11 (x, y) 2 cf 1 (x, y) 3 (c 3 1) G, (6.4) where c is the weight factor; G is the result of the action of a blurring linear spatial filter, for example, the Gaussian (6.2). Recall that as a result of applying blur filters, areas with constant brightness remain unchanged, and the brightness of the pixels of the remaining areas in the resulting image is always less than the brightness of the corresponding pixels in the original image. Then, as a result of image processing according to (6.4), the regions of constant brightness retain the values ​​of the original image, and the brightness of the remaining pixels will increase by the amount of blurring taking into account the weighting factor. 72 7. SEGMENTATION OF IMAGES 7.1. Segmentation of binary images Image segmentation is usually understood as the process of splitting it into component parts that have a meaningful meaning. There are dozens of known segmentation algorithms, but most of them can be reduced to identifying the similarity between individual image points in order to find, in a sense, homogeneous areas. As a result of segmentation, each point of the image must be assigned the number of the segment to which this point is assigned, and the number of segments is not known in advance. The main difficulty of the segmentation problem lies precisely in the choice and formalization of the concept of homogeneity. Image segmentation into a number of homogeneous areas is performed according to the rule of connectivity individual elements and the measure of homogeneity, which determines the similarity of related elements to each other. The elements can be both individual points and their aggregates, united according to the principle of proximity of any properties. In the latter case, the segmentation of a complex image turns into a hierarchical process. If brightness is selected as a characteristic of homogeneity, then for a discrete image in a homogeneous region, connected pixels having the same or similar brightness are grouped. In the latter case, the segmentation result will be determined by the choice of the proximity threshold level. For binary images, the condition of closeness in brightness is trivial, and the decision about the belonging of a pixel to a segment is made based on the analysis of connectivity. Pixel connectivity defines a formal rule that determines which pixels are considered adjacent. Most often, for each pixel, either a region of four pixels adjacent to it in a row and a column, or a region of eight nearest pixels, including diagonal pixels from the 3 ´ 3 neighborhood, is considered as related, although 73 and more complex ones are sometimes used definitions of connectivity. Formally, the set of peaks P forming a segment is called eight connected if between any two of its elements a and b there is a sequence of elements (ek Î P) k = 0,…, K such that Fig. 7.1. Definition of e0 = a; eK = b and for any k, 0

One of the main goals of computer vision in image processing is to interpret the content in the image. To do this, it is necessary to qualitatively separate the background from the objects. Segmentation divides an image into its constituent parts or objects. It separates the object from the background so that you can easily process images and identify its contents. In this case, the selection of contours in the image is a fundamental tool for high-quality image segmentation. In this article, an attempt is made to study the performance of frequently used edge detection algorithms for further image segmentation, as well as their comparison using the MATLAB software tool.

Introduction

Image segmentation is a huge step for image analysis. It divides the image into its constituent parts or objects. The level of detail of the shared areas depends on the problem being solved. For example, when the objects of interest cease to maintain integrity, are broken into smaller, component parts, the segmentation process should be stopped. Image segmentation algorithms are most often based on the discontinuity and similarity of values ​​in an image. The luminance discontinuity approach is based on abrupt changes in intensity values, while similarity is based on dividing an image into similar areas according to a number of predetermined criteria. Thus, the choice of the image segmentation algorithm directly depends on the problem that needs to be solved. Edge detection is part of image segmentation. Consequently, the efficiency of solving many problems of image processing and computer vision depends on the quality of the selected boundaries. Highlighting them in the image can be classified as segmentation algorithms based on brightness discontinuities.

The process of detecting fine discontinuities in the brightness of an image is called the edge enhancement process. Gaps are abrupt changes in a group of pixels that are the boundaries of objects. The classic edge detection algorithm uses image convolution using an operator that is based on sensitivity to large differences in brightness in the image, and returns zero when passing through homogeneous areas. A huge number of edge detection algorithms are now available, but none of them is universal. Each of the existing algorithms solves its own class of problems (that is, it qualitatively distinguishes boundaries of a certain type). To determine the appropriate edge detection algorithm, it is necessary to take into account such parameters as the orientation and structure of the outline, as well as the presence and type of noise in the image. Operator geometry sets the characteristic direction in which it is most sensitive to boundaries. The existing operators are for finding vertical, horizontal, or diagonal boundaries. Selecting the boundaries of objects is a difficult task in the case of a very noisy image, since the operator is sensitive to changes in brightness, and, therefore, the noise will also be considered as some object in the image. There are algorithms that allow you to largely get rid of noise, but in turn, they significantly damage the edges of the image, distorting them. And since most of the processed images contain noise, noise reduction algorithms are very popular, but this affects the quality of the selected contours.

Also, when detecting the contours of objects, there are problems such as finding false contours, positioning contours, missing true contours, noise in the form of noise, high computation time, etc. Therefore, the goal is to investigate and compare many processed images and analyze the quality of the algorithms in various conditions.

This article is an attempt to review the most popular algorithms for the selection of contours for segmentation, as well as their implementation in the MATLAB software environment. The second section introduces the fundamental definitions that are used in the literature. The third one provides theoretical and mathematical and explains various computer approaches to contouring. Section four provides a comparative analysis of various algorithms, accompanied by images. The fifth section contains an overview of the results obtained and a conclusion.

Image segmentation

Image segmentation is the process of dividing a digital image into multiple regions or sets of pixels. In fact, it is a division into different objects that have the same texture or color. The result of the segmentation is a set of regions covering the entire image together and a set of contours extracted from the image. All pixels from the same area are similar in some way, such as color, texture, or intensity. Adjacent areas differ from each other in the same characteristics. Various approaches to finding the boundaries between regions are based on inhomogeneities in the intensity levels of brightness. Thus, the choice of the image segmentation method depends on the problem that needs to be solved.

Domain-based methods are continuity-based. These algorithms divide the entire image into sub-areas depending on some rules, for example, all pixels of a given group must have a certain gray value. These algorithms rely on common patterns of intensity values ​​in clusters of neighboring pixels.

Threshold segmentation is the simplest type of segmentation. On its basis, areas can be classified according to a basic range of values ​​that depend on the intensity of the image pixels. Thresholding converts the input image to binary.

Segmentation techniques based on area detection find abrupt changes in intensity values ​​directly. Such methods are called boundary methods. Border detection is a fundamental problem in image analysis. Boundary extraction techniques are commonly used to find irregularities in a grayscale image. Finding gaps in a grayscale image is the most important approach when highlighting edges.

Border detection algorithms

The boundaries of objects in the image greatly reduce the amount of data that needs to be processed, and at the same time retains important information about the objects in the image, their shape, size, quantity. The main feature of the border detection technique is the ability to extract an accurate line with a good orientation. There are many algorithms described in the literature that allow you to detect the boundaries of objects, but nowhere is there a description of how to evaluate the processing results. The results are assessed on a purely individual basis and depend on the area of ​​their application.

Edge detection is a fundamental tool for image segmentation. Such algorithms transform the input image into an image with object outlines, mainly in gray tones. In image processing, especially in computer vision systems, with the help of contour extraction, important changes in the level of brightness in an image, physical and geometric parameters of an object on a scene are considered. It is a fundamental process that outlines objects, thereby gaining some knowledge of the image. Boundary detection is the most popular approach for detecting significant discontinuities.

The border is the local variation in brightness in the image. They usually run along the edge between the two areas. Boundaries can be used to gain a basic understanding of the image. Their acquisition functions are used by advanced computer vision algorithms and fields such as medical imaging, biometrics, and the like. Border detection is an active area of ​​research as it facilitates high-level image analysis. There are three types of breaks in grayscale images: point, line, and border. Spatial masks can be used to detect all three types of discontinuities.

In the technical literature, a large number of algorithms for the selection of contours and boundaries are given and described. This paper discusses the most popular methods. These include the Roberts, Sobel, Prewitt, Kirsch, Robinson operator, Canny's algorithm, and the LoG algorithm.

Roberts operator

The Roberts boundary highlighting operator was introduced by Lawrence Roberts in 1964. It performs simple and fast 2D spatial dimension calculations on an image. This technique emphasizes areas of high spatial frequency, which often correspond to edges. A grayscale image is fed to the operator's input. The value of the pixels of the output image at each point assumes a certain amount of the spatial gradient of the input image at the same point.

Sobel operator

The Sobel operator was introduced by Sobel in 1970. This boundary detection method uses an approximation to the derivative. This allows the edge to be detected where the gradient is highest. This method detects the number of gradients in the image, thereby highlighting areas of high spatial frequency that correspond to the edges. In general, this led to finding the estimated absolute value of the gradient at each point in the input image. This operator consists of two 3 × 3 matrices. The second matrix differs from the first only in that it is rotated 90 degrees. This is very similar to the Roberts operator.

The detection of boundaries by this method is computationally much easier than by the Sobel method, but it leads to more noise in the resulting image.

Operator Prewitt

Boundary detection by this operator was proposed by Prewitt in 1970. The correct direction in this algorithm was to estimate the size and orientation of the boundary. Even though delineating boundaries is a tedious task, this approach yields quite good results. This algorithm is based on the use of 3 by 3 masks, which take into account 8 possible directions, but straight directions give the best results. All convolution masks are calculated.

Kirsch operator

Boundary detection by this method was introduced by Kirsch in 1971. The algorithm is based on the use of just one mask, which is rotated in eight main directions: north, northwest, west, southwest, south, southeast, east and northeast. The masks are as follows:

The boundary value is defined as the maximum value found using the mask. The direction determined by the mask gives the maximum value. For example, the k 0 mask corresponds to the vertical border, and the k 5 mask corresponds to the diagonal one. You can also notice that the last four masks are actually the same as the first, they are mirror images about the central axis of the matrix.

Robinson Operator

Robinson's method, introduced in 1977, is similar to Kirsch's, but is easier to implement due to the use of coefficients 0, 1, and 2. The masks of this operator are symmetric about the central axis filled with zeros. It is enough to get the result from processing the first four masks, while the rest can be obtained by inverting the first.

The maximum value obtained after applying all four masks to the pixel and its surroundings is considered the magnitude of the gradient, and the angle of the gradient can be approximated as the angle of the masked zero lines that give the maximum response.

Contour selection using Marr-Hildreth method

Marr-Hildreth (1980) method is a digital image edge detection technique that detects continuous curves wherever rapid and abrupt changes in the brightness of a group of pixels are noticeable. This is a fairly simple method, it works using image convolution with a LoG function or as a fast approximation with DoG. Zeros in the processed result correspond to contours. The boundary detector algorithm consists of the following steps:

  • blur the image using the Gaussian method;
  • applying the Laplace operator to a blurry image (often the first two steps are combined into one);
  • we make a calculation cycle and in the result we look at the sign change. If the sign has changed from negative to positive and the value of the change in value is more than a certain predetermined threshold, then define this point as a boundary;
  • For best results, a step using the Laplace operator can be performed through hysteresis, as implemented in Canny's algorithm.

Contour selection by LoG method

The Laplassian Gaussian contouring algorithm was proposed in 1982. This algorithm is the second derivative, defined as:

It is carried out in two steps. In the first step, it smooths the image and then calculates the Laplace function, which results in the formation of double contours. Defining contours is reduced to finding zeros at the intersection of double boundaries. The computer implementation of the Laplace function is usually carried out through the following mask:

Laplassian usually uses finding the pixel on the dark or light side of the border.

Canny Border Detector

The Canny Border Detector is one of the most popular edge detection algorithms. It was first proposed by John Canney in his master's thesis in 1983, and is still superior to many algorithms developed later. An important step in this algorithm is the elimination of noise on the contours, which can significantly affect the result, while it is necessary to preserve the boundaries as much as possible. This requires careful selection of the threshold value when processing this method.

Algorithm:

  • blur the original image f (r, c) using the Gaussian function f ^ (r, c). f ^ (r, c) = f (r, c) * G (r, c, 6);
  • search for a gradient. Borders are outlined where the gradient is at its maximum;
  • suppression of non-maxima. Only local highs are marked as boundaries;
  • the resulting boundaries are determined by suppressing all edges that are not bound to a specific boundary.

Unlike the Roberts and Sobel operators, Canny's algorithm is not very susceptible to image noise.

Experimental results

This section presents the results of the previously described algorithms for detecting the boundaries of objects in the image.

All the described algorithms were implemented in the MATLAB R2009a software environment and tested on a photograph of the university. The purpose of the experiment is to obtain a processed image with perfectly defined contours. The original image and the results of its processing are shown in Figure 1.

Figure 1 - The original image and the result of the work of various algorithms for extracting contours


When analyzing the results obtained, the following regularities were revealed: the operators of Roberts, Sobel and Prewitt give very different results. Marr-Hildreth, LoG, and Kanney found the contours of the object almost identically, while Kirsch and Robinson gave the same result. But observing the results obtained, we can conclude that Canny's algorithm does an order of magnitude better than others.

conclusions

Image processing is a rapidly developing area in the discipline of computer vision. Its growth is based on high achievements in digital image processing, development of computer processors and information storage devices.

In this article, an attempt was made to study in practice the methods of highlighting the contours of objects based on the discontinuities of the brightness of a grayscale image. The study of the relative performance of each of the methods presented in this article was carried out using the MATLAB software tool. Analysis of the image processing results showed that methods such as Marr-Hildreth, LoG and Canny give almost the same results. But still, when processing this test image, the best results can be observed after the operation of the Canny algorithm, although under other conditions another method may turn out to be better.

Even taking into account the fact that the issue of detecting boundaries in an image is sufficiently well illuminated in modern technical literature, it still remains a rather laborious task, since the qualitative selection of boundaries always depends on many factors influencing the result.

List of used literature

1. Canny J.F. (1983) Finding edges and lines in images, Master's thesis, MIT. AI Lab. TR-720.
2. Canny J.F. (1986) A computational approach to edge detection, IEEE Transaction on Pattern Analysis and Machine Intelligence, 8. - P. 679-714.
3. Courtney P, Thacker N.A. (2001) Performance Characterization in Computer Vision: The Role of Statistics in Testing and Design, Chapter in: Imaging and Vision Systems: Theory, Assessment and Applications, Jacques Blanc-Talon and Dan Popescu (Eds.), NOVA Science Books.
4. Hanzi Wang (2004) Robust Statistics for Computer Vision: Model Fitting, Image Segmentation and Visual Motion Analysis, Ph.D thesis, Monash University, Australia.
5. Huber P.J. (1981) Robust Statistics, Wiley New York.
6. Kirsch R. (1971) Computer determination of the constituent structure of biological images, Computers and Biomedical Research, 4. - P. 315–328.
7. Lakshmi S, Sankaranarayanan V. (2010) A Study of edge detection techniques for segmentation computing approaches, Computer Aided Soft Computing Techniques for Imaging and Biomedical Applications. - P. 35-41.
8. Lee K., Meer P. (1998) Robust Adaptive Segmentation of Range Images, IEEE Trans. Pattern Analysis and Machine Intelligence, 20 (2). - P. 200-205.
9. Marr D, Hildreth E. (1980) Theory of edge detection, Proc. Royal Society of London, B, 207. - P. 187-217.
10. Marr D. (1982) Vision, Freeman Publishers.
11. Marr P., Doron Mintz. (1991) Robust Regression for Computer Vision: A Review, International Journal of Computer Vision, 6 (1). - P. 59-70.
12. Orlando J. Tobias, Rui Seara (2002) Image Segmentation by Histogram Thresholding Using Fuzzy Sets, IEEE Transactions on Image Processing, Vol.11, No.12. - P. 1457-1465.
13. Punam Thakare (2011) A Study of Image Segmentation and Edge Detection Techniques, International Journal on Computer Science and Engineering, Vol 3, No.2. - P. 899-904.
14. Rafael C., Gonzalez, Richard E. Woods, Steven L. Eddins (2004) Digital Image Processing Using MATLAB, Pearson Education Ptd. Ltd, Singapore.
15. Ramadevi Y. (2010) Segmentation and object recognition using edge detection techniques, International Journal of Computer Science and Information Technology, Vol 2, No.6. - P. 153-161.
16. Roberts L. (1965) Machine Perception of 3-D Solids, Optical and Electro-optical Information Processing, MIT Press.
17. Robinson G. (1977) Edge detection by compass gradient masks, Computer graphics and image processing, 6. - P. 492-501.
18. Rousseeuw P. J., Leroy A. (1987) Robust Regression and outlier detection, John Wiley & Sons, New York.
19. Senthilkumaran N., Rajesh R. (2009) Edge Detection Techniques for Image Segmentation - A Survey of Soft Computing Approaches, International Journal of Recent Trends in Engineering, Vol. 1, No. 2. - P. 250-254.
20. Sowmya B., Sheelarani B. (2009) Color Image Segmentation Using Soft Computing Techniques, International Journal of Soft Computing Applications, Issue 4. - P. 69-80.
21. Umesh Sehgal (2011) Edge detection techniques in digital image processing using Fuzzy Logic, International Journal of Research in IT and Management, Vol.1, Issue 3. - P. 61-66.
22. Yu, X, Bui, T.D. & et al. (1994) Robust Estimation for Range Image Segmentation and Reconstruction, IEEE trans. Pattern Analysis and Machine Intelligence, 16 (5). - P. 530-538.