Practical study for comparing edge detection filters in digital image processing

Edge detection is a fundamental and important tool in image processing and computer vision. The research topic discusses edge extraction of a digital image using various digital image processing techniques. Digital image edge identification using variety of digital image processing methods. The most popular technique for identifying discontinuities in intensity levels is edge detection. The actual image contains noise that could affect the digital image's quality. Some edge detection filters were used such as Canny, Sobel, and Prewitt. Laplace of Gaussian (LOG) edge recognition, Robert boundary detection, zero edge recognition and analysis. In light of the results of the comparison of edge filters the best edge filter had been obtained. Also, a hybrid method that merges between Canny filter and morphology operations were produced for edge detection. The research aims to reach an appropriate image purification by using different types of filters and to reduce distortions at the edges of the image and to determine which type of filter is the best. As well as, a comparison operation is applied between the traditional method and the hybrid method. Following the results explained by


1.Introduction
Digital images have become an essential part of information systems for many different applications and as a visual representation of an array of integers.These values are determined by the shade of grayscale in the case of grayscale images or a specific color in the case of color images.Recently, image processing widely used and regarded as one of the fascinating information revolution's most significant aspects.Sending and receiving complex information in the form of digital images has become the main method of communication at the present time [1].The digital image is defined as discrete samples organized in a specific space and containing digital data.Their values represent the illumination of the unit in the image.The image is represented as a two-dimensional matrix and is expressed by a variable with two coordinates (i,j).Where (i) represents the horizontal coordinate and (j) represents the vertical coordinate [1] [2].In order to increase the sharpness of an image or video, the edge contrast is enhanced using the edge enhancement image processing filter (apparent sharpness).The filter defines the limits of distinct edges in an image.For instance, the edge in a contrasting color that separates the foreground from the background image.Additionally, increase the contrast of the image near the edge.Overshoot and undershoot are terms used to describe the faint bright and dark highlights that are created on either side of any image's edge.In addition, shortening the subject, which makes the edge appearance more clear when seen from a classic watching distance.This process is prevalent in video and images, and appears to some extent in the majority of broadcast television and DVDs.Controlling the "sharpness" of a modern TV is model of edge enhancement.It is commonly used in computer laser printer especially for text and/or charts for best print superiority.Most digital cameras also make certain edge improvements [3].In general, there are two main purposes of image processing presentations.The first is to improve imageries in some way to facilitate their interpretation by people as well as to support subsequent processing steps.The second purpose is concerned with image analysis to extract certain information from them in order to understand and interpret them from the computer [1].The research includes the first Section is the introduction that discusses image processing, edge detection, and filters.The Second Section View Image Processing Essentials While the Third Section discusses edge enhancement methods and filter type important for defining edges and related works.The Forth Section shows the filters used.Fifth Section discuss the practical side and the application of these filters also the hybrid method between canny and morphological operations.In addition, the results and analysis, as well as a comparison operation between the methods.Then the conclusions and future work.Finally the References.

Image Processing Essentials
An image is a two-dimensional function f(x,y),where x and y are the spatial(plane) coordinates, and the amplitude of at any pair of coordinates (x,y) is called the intensity of the image at that level [1].If (x,y) and the amplitude values of fare finite and discrete quantities, we call the image a digital image.A digital image is composed of a finite number of elements called pixels, each of which has a particular Position and rate.Digital image is categorized as follows [1]: -Indexed Images Indexed images contain an array of data x and the color map of the matrix.The matrix data can be 8-bit or 16-bit.As for the color map of the image, it is a matrix whose dimensions are m-by-3 containing values with a range of (0 to 1).Each row of the map defines the compounds of red, green and blue as one color.Indexed images use direct mapping of values in the image, where each -Colored(RGB) images RGB images are sometimes called True Color images.These images are stored in the form of a three-dimensional matrix, as it identifies the compounds of the red, green, and blue colors in each image point, and it is in the dimensions m-by-n-by-3.

Image Enhancement and Related Works
The goal of enhancement techniques is to produce a specific image that is more appropriate for a specific application.It may not be the best method to improve images of Mars transmitted by a space probe, but there may be a useful way to improve them.Image enhancement is an important image processing technique that can improve the quality of images.The goal of image optimization is to scale a dynamic series of specific features so that they can be easily identified and thus can improve information in images for human observers.Characteristics can be helpful in assessing a person or thing.They can provide insight into who or what someone or something is, and can help make decisions.The data content will not be increased, but it increases the dynamic range of the selected features so that they can be easily identified, for example, Medical image analysis and satellite image analysis are two different ways of examining data to help diagnose and treat medical conditions.Sharpening is a technique that can be used to sharpen the edges and fine details of an image.Image enhancement is divided into two categories [9].
•Enhancement with Edge Detection.The factor detection system serves to simplify the assessment of photos by appreciably reducing the range of facts to be processed at an equal time because the same time preserving useful structural records about object boundaries [4].The filters have been used withinside the system of figuring out the photo by locating the sharp edges, which can also additionally be discontinuous.These discontinuities supply adjustments in pixel intensities, which define the bounds of the object [5].The part recognition's aim is to find out elements in a digital photo at which the photo brightness adjusts sharply or abruptly.Image thing detection specially offers extracting edges in images by figuring out pixels in which the depth version may be very high [6].Edges are used to the degree the length of an object in a photograph; to isolate particular objects from their background; to apprehend or classify objects [7] [8].

Edge Detection Principles
An edge(boundary) in an image is a notable limited change in the brightness of the image.Edge detection, as its name advises, is the technique of identifying the edges in a picture.The edge detection operation is required due to that the image intensity gaps are caused by differences in depth, surface orientation, scene illumination, and material qualities.The collection of curves was obtained that represent surface markings, object boundaries, and discontinuities in surface orientation.Applying an edge detection method to an image can thereby drastically reduce the quantity of data that needs to be processed and filter out information that might be viewed as less important while maintaining an image's crucial structural qualities.edge detection approaches were classified generally into: • Conventional approach • Deep learning-based approach The first approach has been classified to First order derivative and Second order derivative filters.The two types were discussed in this study they are Canny, Sobel, Prewitt, Laplace of Gaussian (LOG), Roberts and Zero filters.First order derivative also referred to as "gradient operators" they generate a gradient image in which edges are recognized by thresholding by convolving the input image with a modified mask.First order derivatives operators include the majority of classical operators, including Sobel, Prewitt, and Robert.This gradient kernel check for maximum and lowest intensity values to find edges and decides if a pixel must be labeled as an edge by looking at the intensity value distribution around it [10].These kernel operators need longer computation times and cannot be applied in real-time.The Second order gradient is active because tit contain Canny filter which it focuses less on the content of the image and more on local alterations rather than the semantics of the image.These are based on the extraction of zero crossing points in the second order derivative, which shows the presence of maxima in the image.First, an adaptive filter is used to smooth the image [6].Since the filtering function is crucial since the second order derivative is highly sensitive to noise.These operators are descended from a Gaussian's Laplacian (LOG) [10].Edge detection method based on deep learning such as the Holistically Nested Edge Detection, or HED, is a learningbased end-to-end edge detection method.That use a trimmed convolutional neural network that resembles the VGG for the task of image-to-image prediction.The side outputs in the neural network are produced by HED.The final output is created by fusing all of the side outputs [11].holistically-nested edge detection (HED), performs a deep learning model that forces fully convolutional neural networks and deeply managed neural networks.HED automatically crams rich ordered depictions that are important in order to resolve the challenging ambiguity in edge and object edge detection [11].

Conventional Approach
The process takes place in the spatial and occurrence domains.In the occurrence spectrum, a high-occurrence filter is used, which permissions the extraordinary frequencies and crops the low frequency.The high frequencies are confined to the boundaries and the low frequencies were cut at the cutoff region.As for the spatial space, the kernel uses filters to define the edges, and there are several filters for them, including Sobel, Prewitt, Roberts, and Canny [1][3].Digital image boundary detection is an important step in image analysis, including image segmentation, target area identification, and area capture.Edge detection is essential for digital image processing because the edge is the boundary of the subject and background.Only by getting the edge can we distinguish the subject and the background.The basic idea of image edge recognition is to take advantage of the antialiasing operator to partially survive the edge of an image.Then, we define the "edge intensity" of the pixel and extract the set of edge points by setting a threshold.However, the line detected may result in interruption due to the existing noise and darkening of the image.Thus, edge detection has two partsthe first is detecting the edges of an image, and the second is determining where those edges are located: [12][13] [14].1.The set of edge points extracted using edge machinists.2. At the edge pixels, several of these pixels are impassive and some of them may be packed then are connected to get the edge.The kernel is shown in figure 1.

. Laplacian edge filters
Laplacian edge filtering is evolved filters that are employed to identify edges in images that undergo rapid change.It is usual practice to soften the image (for instance, with a Gaussian filter) before applying Laplacian since deriving filters are very sensitive to noise.The Laplacian of Gaussian (Log) process is the name of this two-step method.Log kernel is based on the second derivative of the image.Log will return zero if the image is essentially uniform.The Log will react favorably wherever a change takes place on the darker side and badly on the lighter side.The response will be when employing the filter outlined above, or any other equivalent filter, at a sharp edge between two regions, and the response can have very important and significantly.It is crucial to choose an image type that supports negative values and a wide range before scaling the output because at sharp edges between two regions, the response will be when applying the filter described above, or any other equivalent filter.(32-bit floating-point representation of the image) In figure 5, the Laplacian operator is displayed [11][12].5: Laplacian Operator 4.1.5.Zero filter A gradient filter is a valuable tool that can help identify areas of rapid change in a pixel value.These points usually indicate edges or boundaries.The software looks for places in the image's digital signal where the value is at 0, and marks these as potential edge points.Since the signal crossed the zero point, it is called zero crossing.It is used in industrial radiography as a simple method for segmenting potential defects [6] [11].

Canny filter
Canny's procedure is designed to detect abrupt changes in grayscale intensity in an image.These areas are found by defining image gradients.This tool finds edges by searching for local extremes of the grayscale.It helps you find details and patterns in your data that you may not have seen before.This method uses two thresholds to detect strong and weak edges, including weak edges in the output if they are connected to strong edges.Using two thresholds, Canny's method is less likely than other methods to fool noise and more likely to detect truly weak edges [7][8].The experienced operator is shown in the figure.Canny's algorithm basically finds the edges where the grayscale intensity changes dramatically in the image.These areas are found by defining image gradients.Finds edges by searching for local extremes of the grayscale.This technique practices two limits to detect robust and frail edges, including frail edges in the outcome if they are linked to sturdy edges.Using two limits, Canny's method is different from other methods to fool with noise, and further likely to distinguish true frail edges [7] [8].The Canny kernel is shown in figure (6). -

Research Method
A gray image has been inserted into the program, which is improved by defining the edges in it to make it appear better after various kinds of improvements are made and displayed on various screens.As follows: 1.The color image is entered into the program; preliminary processing operations are performed on it.The gray image is transformed to an intensity image, and finally, the gray image is translated to a monochrome image to be displayed on the screens.Edge filters applied on the binary image, the resultant edge image contains the closest to it to indicate the possibility and efficiency of the filter used.Figure (7) shows the output of the input images as the output of a program.Finally, after the grayscale image is altered into a binary image it is displayed on the screens and compared with corresponding edge images with.The comparison result finds the closest to the original edge image.It indicates the possibility and efficiency of the filter used.Figure (7) shows the output of the input images.Blind Reference less Image Spatial Quality Evaluator (BRISQUE) [16] [17] has been used.This scale calculates the image quality entered into the program, without any comparison with another image.The smaller (BRISQUE) value, determine the better image quality.2. The gray image was added to the defined filters, which are Laplace, canny, and finally Sobel filters.The edge function and the filter name were used to find the edges.Figure (8) shows the resulting images from the filters.The BRISQUE scale for the edge image was calculated.Also, the correlation coefficient between the resulting edge images and the original binary image was found.The correlation coefficient is calculated as in equation ( 1

Outcome Discussion
After executing the program on the input images (football, rose and bird), the edge images were obtained and the coefficients values were estimated.The outputs of the correlation coefficient and the spatial image quality coefficient were analyzed and reviewed.They were recorded in the table (1):   2 is the best (minimum).Therefore, it is clear that the hybrid method is better than    Since the initial stage of object relization is edge detection.In this study we compare the various edge detectors.Utilizing MATLAB ver.2020b, the experimental experiments were carried out.The noise sensitivity of first order derivative operators is relatively high.These operators are not superior than those for second order derivatives.Results using canny are positive.From the results of the study, it was found that the Canny filter is better and more efficient in detecting edges than the other filters used in this research.In comparison to canny, it discovers thin edges.Compared to other edge detectors, it extracts more real edges from low contrast images.So that this characteristic allows for real-world use.Therefore, based on this comparison, we may say that canny filter is the best for edge detection.

Future Works
In future works, the authors propose the following ideas: 1.Using filters to remove noise from the background of the image in order to show the borders more clearly.This, in turn, reflects the enhancement process.2. Using the method of cutting each part of the image separately and treating it in a unique way and merging these parts to be displayed and developed.3. Improving the research work by finding hybrid and integrated methods in image improvement algorithms such as fuzzy logic and swarm intelligence algorithms such as ant intelligence, within enhancement processes.4. Comparing the classical and traditional methods with compression algorithms in detecting Edges, such as wavelength algorithms.
image point color is determined by the corresponding values of x in the color map.-Grayscale images / intensity images Intensity images are an array of data whose values represent the intensity values of the image points, it can be represented by 8-bit or 16-bit.Intensity images store their color map with them in case they are referred to (the colors) again.The matrix elements of the image represent different intensity values called the gray scale level.The intensity of 0 represents the black color, and the intensity of 1, 256, or 65536 represents the white color, that is, it represents the end of the level of the gray scale.-Binary Images Digital binary images, each image point has only one value either (0 or 1) and these values are basically on or off.Accordingly, the digital image is stored in the form of a logical binary matrix consisting of the values of zeros (on pixel) and the values of units (off pixel).

Figure 1 :Figure 2 :Figure 3 : 4
The kernel 4.1.1.Sobel filter Sobel filter finds edges at the maximum gamut as shown in figure 2. This filter works by determined the horizontal edges via finds the difference between the last and the first line as shown in equation 1. Sobel filter finds the vertical edges by the difference between the first column and the last column as shown in equation 2 Sobel Operator   = ( 7 + 2 8 +  9 ) − ( 1 + 2 2 +  3 ) … (1)   = ( 3 + 2 6 +  9 ) − ( 1 + 2 4 +  7 ) … (2) Calculate the diagonal edge with the same rules as above. = |  | + |  | … … … (3) 4.1.2.Prewitt filter The Prewitt filter finds the edges at the maximum gradient Prewitt operator is shown in figure (3) this filter determines the horizontal edges by finding the difference between the First line and the last line as in equation (4).The vertical edges of the Prewitt filter are estimated by the difference between the first column and the last column as in equation (5).as shown by the Prewitt operator as follows[7] [8][15] -Prewitt Operator for vertical edges and horizontal   = ( 1 +  2 +  3 ) − ( 7 +  8 +  9 ) … (4)   = ( 3 +  6 +  9 ) − ( 1 +  4 +  7 ) … (5) The above mask works to find the derivative or the edges surrounding the point Z5.The edge is determined by the derivative connects the two values into equation 6.  = |  | + |  | … … … (6)4.1.3.Roberts FilterIt is a kind of simplest operator, which uses the partial differential operator to search for an edge as shown in figure4.Its influence is superlative for images with sharp noise.Then again, the defined extracted edge image is quite thick using the Roberts kernel, a filter model is shown in figure

Figure ( 7 )
Figure (7) RGB image of the program, the gray and finally the binary image.

Figure ( 8 )
Figure (8) Inserting the grayscale image to Log, Canny and Sobel filters The value of the correlation coefficient is confined between [1, −1], the closer the value to 1, the more matches between the binary image and the edge image and vice versa.The grayscale image was added to the defining filters, which are the Robert filter, zero filter

Figure ( 9 )Figure ( 10 )
Figure (9) Inserting the grayscale image to Roberts, Zero and Prewitt filters Other images were selected randomly and entered to the program.The results as images and quality measures are shown in follows:

Figure ( 14 )
Figure (14) Inserting the grayscale image to Log, Canny and Sobel filters

Figure ( 23
Figure (23)  show an idea that the value from Table2is the best (minimum).Therefore, it is clear that the hybrid method is better than

Figure ( 21 )
Figure (21) Relation between edged images and the correlation coefficient

Figure ( 23 )
Figure (23) Comparison between hybrid and the traditional methods based on BRISQUE

Figure ( 24 )
Figure (24) Comparison between hybrid and the traditional methods

Table ( 1
(1)esearch Quality MetricsFrom the above table, the image quality of the edges can be seen in the sequence of filters Canny filter, Soble filter, Roberts filters, Zero filter, Prewitt filter, and finally LOG filter according to the quality parameter.The Canny filter is the best filter for defining edges according to the quality coefficient a value equal (46.01, 48.84 and 49.43) respectively for the chosen images.To find the closest edge image to the binary image based on correlation coefficient.The resultant edge image produced from the Prewitt filter is closest one with a correlation coefficient equals to (0.3133).From table(1)which contain the quality values for the three images, these values were translated to graphs as follows.The results estimated from hybrid method were recorded in Table(2) below.For BRISQUE value the result equals (43.43) which is best than canny filter from table(1).Performance metrics evaluated from hybrid method From looking at Tables1 and Table 2that relate to the BRISQUE value, we choose the three minimum values shaded in table 1.
Table 2 that relate to the Correlation value, we notice in figure (24) that the value from Table 1 is the best (maximum) with Prewitt filter.