1. Introduction
Edge detection is a useful step toward visual object detection and image segmentation. An edge is normally extracted by the observation of the intensity changes inside the region of interest of the entire image. Therefore, different gradient calculation measures have been developed in the literature to find the abrupt changes of the pixel’s qualities. The Robert edge detection algorithm, as a basic method of edge detection, calculates the discrete differentiation between the diagonally adjacent pixels [
1,
2]. Similarly, Sobel edge detection and Prewitt edge detection perform the same process of differentiation inside the horizontal and vertical masks, respectively. Canny edge detection is considered as the standard edge detection technique, where the process is performed in three stages. Firstly, the image goes through the Gaussian filter to be smoothed. Secondly, the directional gradient is calculated to estimate the edges. The third step is the post-processing, where it is attempted to thin the edges [
3]. The smoothing of the image is also used in the other well-established algorithms of edge detection, such as Laplacian of Gaussian (LoG), where the sum of the second derivative of the Gaussian function is used [
4]. However, the variation of the pixel values across the region of interest and the induced noises during the recording and transformation can degenerate the image detection process. Readers interested in a survey of the mentioned algorithms are referred to [
1,
5,
6].
The wider applications of the image processing algorithms in industry, robotics, military, geography, and medical diagnosis detection have acted as a motor for the development of the recent algorithms in the image segmentation [
7,
8,
9], morphological operations [
3], and noise removal [
10]. The basic edge detection algorithms have been highly extended in recent years. For instance, for the better smoothing of images, the geometry of images has been used upon the bandlet transformation to improve the performance of edge detection algorithms in [
11]. The Faber Shcauder wavelet transformation has been used with a bilateral filtering method in [
12]. Many research works also have been performed to tackle the noise reduction problem in edge detection.
Normally, it is impossible to identify the kind or level of noise in an image; however, it is believed that the impulse (type) noises are more related to the image acquisition process (i.e., scanning and motion blurring) and the Gaussian (type) noises are related to the transmission process. Hence, many researchers have focused on soft computing methods and fuzzy models for the development of the robust algorithms of the edge detection of the noisy images [
5,
13,
14]. Soft computing methods and fuzzy models, in general, can incorporate more parameters and different high-pass or low-pass filters into the edge detection algorithm and therefore preserve the edges while simultaneously smoothing the noises [
1].
Several applications of the standard fuzzy logic-based edge detection have been reported in the literature. In [
1], the type-2 fuzzy model has been employed. The anisotropic filtering has been developed in [
15]. In [
16], a modified region growing procedure is introduced to evaluate the distance between a pixel and the region. However, the shortages of the fuzzy models in general are as follows:
Although it is proved that the fuzzy models can approximate any continuous function in the compact set, their derivative is not continuous. In other words, the fuzzy models are not smooth [
17].
The type-2 fuzzy logics improve the performance of the edge detection algorithms; however, they demand higher computational power in parallel.
The selection of the best shape of membership function (MF) is mostly a problematic matter in the design step, and many developed methods are only applicable to a special shape of MF.
Therefore, in the present manuscript, we intend to employ the smooth fuzzy compositions (SFCs) for edge detection and noise removal purposes. The novelties and contributions of the proposed method are as follows:
The fuzzy models with smooth compositions are classified as type-1 fuzzy models. Therefore, they do not call for notably higher computational power compared to the standard fuzzy models of min–max and product–sum compositions.
Considering the structural properties, the smooth fuzzy models (SFMs) are bounded variation functions, enabling them to dampen the noises in the image, even at low signal-to-noise ratios (SNRs).
The results for the bounded variation property are general for all MF selections.
The bounded variation property of the smooth compositions is the backbone of the proposed approach in the manuscript, and we have compared the total variation denoising of the smooth fuzzy compositions to the standard fuzzy compositions through quantitative methods. Upon this characteristic, therefore, the smooth fuzzy models would preserve the edges and important information of the images. This capacity has been demonstrated through the comparison of Pratt’s figure of merit (PFOM) values of the different models.
Two cases of Gaussian noise and Impulse noise have been considered in the simulations. Considering that the source and type of the noises usually are not determined, and the proposed method is able to remove both types of noises, the results are highly applicable to real applications.
Therefore, the structure of the manuscript is as follows. We begin with the preliminaries of the functional analysis and then introduce the general fuzzy modeling and the smooth fuzzy modeling schemes. In the next section, we elaborate on the bounded variation property of the smooth fuzzy compositions and contrast the total variation denoising of the smooth fuzzy compositions toward the standard fuzzy compositions. After that, we employ the obtained results for the edge detection of the images and demonstrate the higher performance of the smooth compositions over the standard fuzzy compositions for the edge detection. Finally, the results are discussed, and the paper is concluded.
4. Application to Edge Detection of Images
In this section, we verify how the employment of smooth fuzzy compositions removes noises and preserves the edges of the images. In the previous section, it was demonstrated that smooth fuzzy compositions outperformed the standard fuzzy compositions in dampening the effect of the noises. Therefore, for the edge detection of images, the application of the smooth compositions has been compared to the standard fuzzy compositions, and to make a fair comparison, the same structure of the fuzzy model has been considered for both types of compositions.
4.1. Non-Fuzzy Edge Detection
In the classical edge detection algorithm, the Sobel operators are employed as the vertical and horizontal derivative approximations of the image. The algorithm employs Sobel operators throughout the horizontal axis and vertical axis, as follows:
which act as three-by-three convolution masks on the image. Therefore, the gradients along both axes are determined as follows:
where ∗ represents the convolution operator. It is attempted to detect the zero-crossings of the first-order directional derivative in the gradient direction of the image by the minimization of the following function:
4.2. Fuzzy Edge Detection
For the fuzzy edge detection algorithm, we consider four inputs to the fuzzy system. The first two inputs are the vertical and horizontal derivative approximations of the image,
and
, respectively. The third input to the fuzzy system is the output of the image through a convolution mask of a low-pass filter, which is as follows:
The fourth input to the fuzzy system is the output of a convolution mask of a high-pass filter, which is as follows:
Consequently, the fuzzy model
can be constructed upon the suitable synchronization of the rules on the inputs. The rule basis for this fuzzy system is shown in
Table 3. The MFs for all the inputs and the output are shown in
Figure 3. The range on which the MFs are defined is flexible for the inputs and can extend further than 255 or lower than 0. However, the range of MF is fixed for the output,
.
The fuzzy model detects the edges of the image in the range from 0 to 255. It is known that in the grayscale format, 255 corresponds to white and 0 means black, and therefore, the closer a pixel is to 255, the greater the probability of the pixel being identified as an edge pixel.
Figure 4 illustrates the developed fuzzy inference system for this paper.
Therefore, very similar to (
30), the zero-crossings detection of the image can be carried out through the minimization of the first-order derivative of the fuzzy model as follows:
The numerical solution of the minimization problem (
33) is equal to the minimization of the norm function
over the bounded variation search space of the image
, rewritten as follows:
4.3. Noise Removal Characteristics of the Smooth Fuzzy Model
We consider the noisy image
as the output of the fuzzy model designed for the edge detection, added to the independently and identically distributed zero-mean Gaussian random variable
, as
. We amplify the minimization problem (
34) to estimate the denoised image
as the solution of the following problem:
where
is a positive parameter. The first term in the minimization avoids the solution from the oscillation behavior in the edge detection and smooths the images. The second term runs the smooth fuzzy model to remove the noise and to be close to the edges.
Lemma 3. The solution of the minimization problem (35) exists and is unique and stable with respect to the perturbations. Proposition 3. The same conclusions of the noise-removing capacity of the smooth fuzzy models can be deduced for the definition of the Laplace noise and the minimization problem shown below: Proposition 4. The same conclusions of the noise-removing capacity of the smooth fuzzy models can be deduced for the definition of the Poisson noise and the minimization problem shown below: 4.4. The Proposed Procedure
The grayscale image is used as the input to the fuzzy model of the edge detector system. Canny is used as the ideal edge detector for comparison using the PFOM value. A threshold filter is applied to the output image of the fuzzy model (fuzzy inference system) in such a way that the pixels with values higher than the threshold can be considered as the edge pixels (with pixel value being equal to 255), and the rest are considered as the non-edges (with a pixel value equal to 0). This process is called binarization.
In fact, in the binarization process, the threshold value for each image is selected adaptively. The output of the fuzzy inference system is a denoised gray-scale image with the edge pixels being more discernible than those of the input. Since the output pixels have values between 0 and 255, the threshold value will be a value in this range that provides the maximum PFOM in comparison with the ideal edge-detected image. In other words, a loop sweeps the interval of
and selects the value that maximizes the PFOM. Finally, the edge-detected image pixel values will be either 0 or 255, which is called binarization. The employed procedure is illustrated in Algorithm 1 and
Figure 5.
4.5. Comparison Instrument
Before proceeding to the edge detection, we need to choose the most fitted measure of distance, according to
Section 3.1. The difference of the distance measures has been illustrated by the numerical comparison of an example in
Figure 6, in which the pixel “aa” is located at
and the pixel “bb” is located at
. The measures introduced above are used for the calculation of distance between the pixels as follows:
The “Euclidean distance” is based on the actual physical distance; however, the “Chessboard distance” can demonstrate movement in eight directions, which are almost all possible movements in an image. Secondly, with the employment of the “Chessboard distance,” the detected edges would have the same probability of belonging to the ideal edges.