Edge detection is the process of determining where boundaries of objects fall within an image. So far, several standard operators-based methods have been widely used for edge detection. However, due to inherent quality of images, these methods prove ineffective if they are applied without any preprocessing. In this paper, an image preprocessing approach has been adopted in order to get certain parameters that are useful to perform better edge detection with the standard operators-based edge detection methods. The proposed preprocessing approach involves computation of the histogram, finding out the total number of peaks and suppressing irrelevant peaks. From the intensity values corresponding to relevant peaks, threshold values are obtained. From these threshold values, optimal multilevel thresholds are calculated using the Otsu method, then multilevel image segmentation is carried out. Finally, a standard edge detection method can be applied to the resultant segmented image. Simulation results are presented to show that our preprocessed approach when used with a standard edge detection method enhances its performance. It has been also shown that applying wavelet edge detection method to the segmented images, generated through our preprocessing approach, yields the superior performance among other standard edge detection methods.
Edge detection is basically an image segmentation technique that divides spatial domain, on which the image is defined into meaningful parts or regions [
Wavelet analysis is an efficient tool for edge detection. Deterministic methods are inappropriate when noise models are applied. In images with low SNR, the noise must be accounted with a noise model, multiplicative or additive [
This paper presents a preprocessing approach to enhance the performance of standard operators-base edge detection methods. The approach consists of computation of the image histogram, finding out the total number of peaks and suppressing irrelevant peaks. From the intensity values corresponding to relevant peaks, threshold values are obtained. From these threshold values, optimal multilevel thresholds are calculated using the Otsu method, then multilevel image segmentation is carried out. Finally, a standard edge detection method is applied to the resultant segmented image. The rest of the paper is organized as follows: In Section 2, a review of standard operator-based edge detection methods are described, advantage and disadvantage of these methods are summarized and standard wavelet edge detection method is also explained. In Section 3, the edge detection with the proposed preprocessing approach is introduced. Section 4 presents simulation results and shows a quantitative comparison between several preprocessed standard edge detection methods and these standard methods without the preprocessing. We draw the conclusion in Section 5.
Edge detection is the process of determining where edges of objects fall within an image.
The gradient method detects the edges by looking for the maximum and minimum in the first derivative of the
image. Thus, consider the two dimensional function
The gradient magnitude can be computed by the formula:
The gradient direction can be computed by the formula:
The magnitude of the gradient computed by Equation (2) gives edge strength and the gradient direction is always perpendicular to the direction of the edge. Robert, Sobel, and Prewitt operators are classified as standardfirst order derivative operators which are easy to operate but highly sensitive to noise [
The input image is convolved with the default kernels of operator and gradient magnitude and directions are computed. It uses the following 2 × 2 two kernels [
The plus factor of this operator is its simplicity but having small kernel it is highly sensitive to noiseand not compatible with today’s technology [
It convolves the input image with kernel and computes the gradient magnitude and direction. It uses the following 3 × 3 two kernels:
As compared to Robert operator, Sobel operator has slow computation. However it is less sensitive to noise as compared to Robert operator.
Prewitt edge operator gives better performance than that of Sobel operator. The function of Prewitt edge detector is almost the same as Sobel detector but have different kernels:
Any definition of a second derivate 1) must be zero in flat areas; 2) must be nonzero at the onset and end of a gray level step and ramp; and 3) must be zero along ramps of constant slope [
There are several ways to define digital Laplacian using neighborhoods. Whatever the definition, it has to satisfy the properties of a second derivate outlined in Equation (11). The following notation is used for second order derivative in the x and y directions [
Furthermore, when the first derivative is at a maximum, the second derivative is zero [
Laplacian of an image
In this case, Laplacian kernel given by the following equation is adopted.
The Laplacian of Gaussian (LoG) follows the following four steps [
1) Smooth the image using Gaussian filter which is defined by:
2) Enhance the edges using Laplacian operator which given by this equation [
3) Estimate the zero crossings denote the edge location.
4) Use linear interpolation to determine the sub-pixel location of the edge.
Greater the value of σ, broader the Gaussian filter, more is the smoothing. Too much smoothing may make the detection of edges difficult; also called the Maxican Hat operator.
To reduce the computational requirements, the LoG is approximated by the DoG. The width of the edge can be adjusted by changing
LoG requires large computation time for a large edge detector mask. Second Order Derivative Methods Properties. The following are the three most important properties of the second order derivatives:
1) Second order derivative methods especially Laplacian, are very sensitive to noise.
2) Probability of false and missing edges remains.
3) Localization is better than gradient operators.
The Canny edge detection algorithm is known to many as the optimal edge detector. Canny’s intentions were to enhance the many edge detectors already out at the time he started his work. He was very successful in achieving his goal and his ideas and methods can be found [
Based on these criteria, the Canny edge detector first smoothies the image to eliminate the noise. It then finds the image gradient to highlight regions with high spatial derivatives. The algorithm then tracks along these regions and suppresses any pixel that is not at the maximum (non-maximum suppression). The gradient array is now further reduced by hysteresis. Hysteresis is used to track along the remaining pixels that have not been suppressed. Hysteresis uses two thresholds and if the magnitude is below the first threshold T1, it is set to zero (made a non-edge). If the magnitude is above the high threshold T2, it is made an edge. And if the magnitude is between the two thresholds, then it is set to zero unless there is a path from this pixel to a pixel with a gradient above the second threshold T2. In order to implement the canny edge detector algorithm, a series of steps must be followed [
Step 1: Smooth the image with a two dimensional Gaussian filters.
Step 2: Take the gradient of the image.
Step 3: The direction of the edge is computed using the gradient in the x and y directions.
Step 4: relate the edge direction to a direction that can be traced in an image.
Step 5: Non-maximum suppression.
Step 6: Hysteresis.
Each edge detection method has its advantages and disadvantages.
First we define a Gaussian equation in two dimensions as [
Method | Advantages | Disadvantages |
---|---|---|
Standard (Sobel, Prewitt, Kirsch) | Simplicity, detection of edges and their orientations | Sensitivity to noise, inaccurate |
Zero crossing (Laplacian, 2nd directional derivative) | Detection of edges and their orientations. Having fixed characteristics in all directions | Responding to some of the existing edges, sensitivity to noise |
Laplacian of Gaussian (LoG)-(Marr-Hildreth) | Finding the correct places of edges, testing wider area around the pixel | Malfunctioning at the corners, curves and where the gray level intensity function varies. Not finding the orientation of edge because of using the Laplacian filter |
Gaussian (Canny, Shen-Castan) | Using probability for finding error rate, localization of response. Improving signal to noise ratio, better detection specially in noise conditions | Complex computations, false zero crossing, time consuming |
where, σ is standard deviation of the signal, and we assume that
The wavelet transform of f(x, y) at the scale s has two components defined by
Wavelet edge detection can be demonstrated as in
We smooth the image and detect the sharp variation points from their first order derivative. The smoothing function is any function whose integral is equal to 1 and that converges to 0 at infinity. One can choose smoothing function equal to a Gaussian.
We assume
By convolving the image with smoothing function we removes small signal fluctuation, then sharp variations will only be detected. The value of σ can be changed from image to image according to the amount of edges and detail. Linear filtering of an image is accomplished through an operation called convolution. In convolution, the value of an output pixel is computed as a weighted sum of neighboring pixels. The matrix of weights is called the convolution kernel, also known as the filter. In general case the wavelet domain in 2-dimension has R4 (Four dimensions) namely (x, y, scale and rotation). At each step, the image is convolved with a wavelet to obtain the coefficients. It is then smoothed with a Gaussian. Both the wavelet and Gaussian filtering are done using separate 1-D filters vertically and horizontally.
In order to compute the local maxima of the modulus of the image in DWT we need to find: 1—the modulus and 2—the angle of the DWT at each scale. The modulus maxima are then defined as the points of the modulus images that are larger than the two neighbors whose positions are in the direction indicated by the angle value at the corresponding location. Now let’s know how we can get first the modulus of the image:
Then we get the angle of the DWT. There are only four possible directions when describing the surrounding pixels: 0 degree (in the horizontal direction), 45 degree (along the positive diagonal), 90 degree (in the vertical direction), or 135 degree (along the negative diagonal). Now from the modulus image and the angular DWT we can find the local modulus maxima.
The edge points can then be gathered together into chains. For point that is a maximum, we can join it with the point closest to it if they have similar angles. They thus define the multi-scale image edges.
Although the maxima of the modulus of the discrete wavelet transform are a good approximation of the edges in an image, even in the absence of noise often there are many false edges as can be seen. Therefore a criterion such as thresholding must be determined to separate the “true” edges from the “false” edges.
The proposed preprocessing involves computation of the histogram, finding out the total number of peaks and suppressing irrelevant peaks. From the intensity values corresponding to peaks, threshold values are obtained. From these threshold values, optimal thresholds are calculated using the Otsu method for multilevel image thresholds [
1. Filter the original image
2. Convert the image to grayscale as shown in
3. Use an averaging mask over the image and resize the image. To limit computation time, we resize the image to have 256 rows and columns that are proportion to it i.e. the original aspect ratio is maintained as shown in
4. A histogram of the image is generated. Thus, the result is of the form [intensity level, number of pixels with that intensity level] as shown in
5. From the histogram data, create a set of values from which the local peaks are counted 58 elements.
6. From the above set, create a set where the peaks that are within 1% of the maximum value (of the number of pixels corresponding to the same intensity level) are counted and others are discarded 57 elements. This factor has been statistically obtained from assessing many images [
7. From the set created in the previous step, remove the peaks that correspond to intensities that are within 20 levels of each other 7 elements. The number 20 is again found effective after experiments by [
8. Using the threshold values above, find out the optimal threshold using Otsu’s method; Thresh = [53 74 98 128 162 190 218].
9. Based in the thresholds obtained from Otsu’s method, segment the resized image as shown in
This section presents a comparison between different edge detection models. For this purpose MATLAB 8.1 (R2013a) program has been adopted to investigate the difference between edge detection models. Namely, BSD (Berkeley Segmentation Dataset) images [
The FoM is defined by
where, false edges are the non-edge pixels identified as edges,
As shown in
Edge Detection Method | PR | PSNR db | FoM | FAC | MSC | |
---|---|---|---|---|---|---|
Roberts | Standard | 9.8844 | 17.2154 | 0.083204 | 1482 | 3934 |
Preprocessed | 9.9116 | 17.2153 | 0.086603 | 1478 | 3926 | |
Prewitt | Standard | 9.5487 | 17.2104 | 0.094635 | 2004 | 3922 |
Preprocessed | 9.6984 | 17.2106 | 0.095899 | 1954 | 3921 | |
Zero Cross (LoG) | Standard | 11.6908 | 17.2118 | 0.12455 | 4792 | 3952 |
Preprocessed | 11.8603 | 17.2120 | 0.12633 | 5086 | 3960 | |
Canny | Standard | 17.1933 | 17.2235 | 0.11672 | 4948 | 3969 |
Preprocessed | 17.2174 | 17.2240 | 0.11936 | 6116 | 3957 | |
Wavelet | Standard | 63.5240 | 17.2272 | 0.047461 | 0 | 2024 |
Preprocessed | 63.5461 | 17.2272 | 0.048007 | 0 | 2012 |
In this paper, we have presented a preprocessing approach in order to enhance the performance of commonly used edge detection methods. The preprocessing approach consists of computation of the image histogram, finding out the total number of peaks and suppressing irrelevant peaks. From the intensity values corresponding to relevant peaks, threshold values are obtained. From these threshold values, optimal multilevel thresholds are calculated using the Otsu method, then multilevel image segmentation is carried out. Finally, a standard edge detection method can be applied to the resultant segmented image. The preprocessing approach has been summarized in steps and demonstrated by an image example. Simulation results have shown that the preprocessing approach is used with standard edge detection methods to enhance their performance. Results have also shown that wavelet edge detection with the preprocessing approach provides the superior performance among other standard methods with and without preprocessing approach.