ON THE PROPERTIES OF SOME ADAPTIVE MORPHOLOGICAL FILTERS FOR SALT AND PEPPER NOISE REMOVAL

,


INTRODUCTION
Impulsive noise (or salt and pepper) is one of the most frequent types of noise present in digital images.This type of noise is caused by several factors such as faulty memory, scanning problems of the video sensors, decoding errors, transmission in a noisy channel, etc.The removing of this type of noise is one of the most important procedures that must be done before analyzing the characteristics of an image.There exists several methods in the literature for the efficient removing of impulsive noise.One of the most used and robust non-linear filters is the standard median filter (SMF) (Huang et al., 1979), nevertheless, as noise increases, noise removing is less effective.Other algorithms like adapted median filter (AMF) (Ibrahim et al., 2008) and the Decision Based Algorithm (DBAIN) (Srinivasan and Ebenezer, 2007) tend to blur and distort the image.On the other hand, the Noise Adaptive Fuzzy Switching Median Filter (NAFSM) (Toh and Mat Isa, 2010) has better results than other median filters however it has a high computational complexity that makes it difficult to carry out.Furthermore, all these methods are focused only on the computational aspects rather than on properties of its filters.In the framework of mathematical morphology, it is common to use combinations of erosions and dilatations for the removing of this type of noise (Maragos and Schafer, 1987;Song and Delp, 1990;Oh and Chaparro, 1998;Mukhopadhysy and Chanda, 2002).Despite the fact that this kind of filters gives good results, as the level of degradation increases, they do not guarantee a good quality of the image.One of the reasons for its inefficiency is that they modify non-noisy pixels in an incorrect way contrary to most of the state-of-the-art filters.Added to this, the theoretical requirement of the property of adjunction between erosion and dilation (Serra, 1983;Debayle and Pinoli, 2005;Ćurić et al., 2014) makes it difficult to define morphological operators that do not modify non-noisy pixels.In the first section of this paper the aforementioned issues are analyzed in detail and illustrated, see figures 1, 3 and 4.
The main objetive of this work is to propose a family of real denoising morphological filters that overcome these difficulties for which it is demostrated that they turn out to be increasing and idempotent operators.Also, they are ∧-filter and ∨-filter which allow to define mophological openings and closings.Finally it is shown that they are efficient for impulsive noise removal in comparison with other morphological filters and finally they are compared qualitatively and quantitatively to other filters from the literature.
The paper is organized as follows.In the first section, some concepts about classical and adaptive mathematical morphology are recalled.Besides the difficulty of defining morphological openings and closings that do not modify non-noisy pixels and at the same time effectively remove impulsive noise is analyzed.In the next section, it is proposed a pair of operators that overcome these dificulties and it is demonstrated to be ∧-filter and ∨-filter (Serra and Vicent, 1992).Then, the proposed filter is evaluated and compared in terms of quality and execution time with some filters of the state of the art.Finally, in the last section, the conclusions are given.

BACKGROUND ON MATHEMATICAL MORPHOLOGY
A digital image can be described by the function where T = {0, 1, ..., L} and L is the maximum value of the intensity scale used.Let (F , ≤) be the lattice of functions with the order: where τ(c, e v , e f ) is the conditional function whose arguments are the logical condition c to evaluate, the function to evaluate e v in case that c = 1 (true) and the function to evaluate e f in case that c = 0 (false).Also ρ(1) is a number generating function with uniform distribution in the interval (0, 1).Note in the function f r that the values to assign are the maximum and the minimum of the gray scale.

CLASSICAL MATHEMATICAL MORPHOLOGY
Classical mathematical morphology studies images through series of operators that are, in a lot of cases, the result of the composition of two basic operations: erosion and dilation.
Definition 1 Erosion and dilation of a function f ∈ F through the structuring element B ⊂ Z 2 are defined as: respectively.Where B = {−x : x ∈ B} is the symmetric set of B, and B x is the translation of B to point x.
One of the fundamental characteristics of this structuring element is that its size is much smaller than the domain of the image to be studied and thus, it acts as a probe or local analyzer.The dilation and erosion are not inverse of each other and, in general, are not invertible.However, this allows defining another pair of operations based on their composition.
Definition 2 The opening and closing of f by structuring element B are defined as, (3) respectively.The filters derived from the composition of the opening and the closing are the morphological operators used to eliminate noise in the grayscale images.Fig. 1 shows the result of applying filters γ B ϕ B γ B and ϕ B γ B ϕ B to Lena image contaminated with impulsive noise of 10% and 30%, using the diamondshaped structuring element.It can be observed that the classic morphological filters are becoming less effective as the level of degradation increases, in addition to its softening effect that is not always something that one would expect to obtain.These problems are due in large part to the fact that the structuring element is the same at each point of the image, without distinguishing between noisy points and points that are important information of the original image.Another filter used in MM for the removing of impulsive noise is the morphological center.
Definition 3 Being {ψ i } a family of operators over F , meaning, ψ i : F → F .The morphological center is defined as Fig. 2 shows the result of applying the morphological center to the Lena image, with a noise level of 10% and 30%, using the family of operators {ψ 1 = γϕγ, ψ 2 = ϕγϕ}.As can be seen, the noise not removed in the images filtered by morphological center is smaller than those in the images filtered by γϕγ or ϕγϕ.

ADAPTIVE MATHEMATICAL MORPHOLOGY
The generalizations of the basic morphological operators (erosion and dilation) make up the area of mathematics known as adaptive mathematical morphology Debayle and Pinoli (2005;a;2009); Angulo and Velasco-Forero (2011); Ćurić et al. (2014);Legaz et al. (2018).These generalizations are based on an essential property known as adjunction that is required to correctly define openings and closing from the combination of erosion and dilation.Let's define some important concepts.
Definition 4 Given Φ : F → F an operator, it is said that: 5. Si Φ is increasing, extensive and idempotent then Φ is a algebraic closing.
6.If Φ is increasing, anti-extensive and idempotent then Φ is an algebraic opening.
7. Φ is a morphological filter if it is increasing and idempotent on a lattice.
Definition 5 The operations ε, δ : F → F form an adjunction on F if: The operations ε B and δ B defined in (2) form an adjunction.On the other hand, in adaptive mathematical morphology the idea is to define a structuring element for each point in the domain of the digital image, which means, we define a family of structuring elements Z(x), where Z : Z 2 → P(Z 2 ) and P(Z 2 ) is the power set of Z 2 .Then we define the operations ε Z and δ Z as: f (y).
(4) In general, these operations are not morphological operations because the pair (ε z , δ z ) does not always fulfill with the property of adjunction.However, given a family Z(x) of subsets of Z 2 so that x ∈ Z(x), if for each x we define Then the pair (ε z , δ Ẑ ) defines an adjunction.The set Ẑ(x) can also be implicitly defined as: Moreover, one of the characteristics that makes many of the algorithms for the removing of impulsive noise efficient is that they preserve the pixels that have not been corrupted.Be f r a noisy image, to ensure that pixels that are not noisy are not modified when morphological operations are applied, we define a family of sets {Z(x)} in such a way that: where R is a set that contains the noisy points and R c is the complement of R, that is, R ∪ R c = Z 2 .Let's see that the property stated in (6) cannot be combined conveniently with the condition stated in (5) to remove impulsive noise because the structuring element Ẑ(x) from each noisy point it turns out to contain only noisy points.Indeed, let x ∈ R such that Ẑ(x) ∩ R c = / 0 and let y ∈ Ẑ(x) ∩ R c , so x ∈ Z(y) = {y} and therefore x = y, which is a contradiction.So that, Ẑ(x) ⊂ R for every x ∈ R. Therefore, the dilation and the operations resulting from its combination with erosion, using a family of structuring elements that complies with the properties established in ( 5) and (6), will not eliminate the noise correctly.Since the morphological operations are not invertible, if we modify a non-noisy point, in general we will not be able to recover it.Therefore, adaptive morphological operators calculated using the reflected structuring element have disadvantages compared to other methods.Fig. 3 shows a magnified section of lena's image with some noisy pixels to which δ Ẑ is applied.Here, Z(x) = B x is the diamondshaped structuring element for each noisy pixel, and Z(x) = {x} for each non-noisy pixel.The structuring elements Z(x) and the reflected structuring elements Ẑ(x) for some pixels were drawn.As can be seen, each neighborhood Ẑ(x) has only noisy pixels and the point x, so the resulting image contains more noisy pixels than original image.Further, the combination of this operation with others operations can also result in a noisier image, see figure 4. In this work we study two operations with a special family of structuring elements that do not modify non-noisy pixels, and even that do not comply with the properties of extensivity and anti-extensivity, and therefore do not define morphological openings and closings, but they are increasing and idempotent, that is, morphological filters.

PROPOSED ADAPTIVE MORPHOLOGICAL FILTER
Considering R, B ⊆ Z 2 so that 0 ∈ B and B = B.For each x ∈ Z 2 we define the function Z R : Z 2 → P(Z 2 ) as: We define the operations ε R , δ R : and the operations γ R , ϕ R : In fact, we have that Z R (x) = B x , Z R (y) = B y and y = x + w where w ∈ B, then x = y + (−w) and −w ∈ B = B, therefore x ∈ B y .
Proof If x ∈ R c then Z R (x) = {x} and the inequality is trivial.Let x ∈ R. Developing the right side of (8) we have the following expression This expression is equivalent to prove that ε R f (x) is lower bound of {γ R f (y)} where y ∈ Z R (x).That is, Proposition 2 Let f , g ∈ F .The following properties are satisfied:

Proof
The properties a) and b) are directly derived from the definition of the operators γ R and ϕ R .Then the proof for idempotence is presented.Let Let's suppose that x ∈ R. By the proposition 1 and the increasing property of δ R we have that On the other hand . The property of duality and the idempotence of the function γ Z imply the following equalities: The pair (ε R , δ R ) does not define an adjunction, and consequently operations γ R and ϕ R are not extensive or anti-extensive then, they do not define morphological openings or closings.However, the operations γ R and ϕ R are idempotent, increasing and, therefore, define morphological filters.Next, we present a couple of filters built from γ R and ϕ R with additional properties.
Given ψ, Φ : F → F two operators, we define the operators ψ ∧ Φ and ψ ∨ Φ as By duality property we have the next equalities The following proposition gives a sufficient condition to build openings and closings.
Because of proposition 4 we have that I ∧ γ R is a morphological opening and I ∨ ϕ R is a morphological closing.

PROPOSED FILTER
In the case of impulsive noise, the noisy pixels are in the set R = {x : f r (x) = 0 or f r (x) = L}, where f r is the noisy image.Next we present a result that will help us to have a simple interpretation of the filters I ∧ γ R and I ∨ ϕ R , and to reduce their computational cost when R is defined as before.
c In any other case The proof that We propose to combine the pairs ( γ R 2 , ϕ R 1 ) and (γ R , ϕ R ), by using the morphological center for the removing of impulsive noise as follows: Where This filter has the advantage of cleaning an image more efficiently compared to the classic morphological center.Next, the algorithm to calculate γ R is proposed.Note that the operation is divided into two parts, first calculated ε R f r and then the composition γ R = δ R (ε R f r ), keeping the family of structuring elements fixed Z R (x) for both operations.

Algorithm
Require: Noisy image f r , set of noisy pixels R, and the structuring element The algorithm to obtain ϕ R is similar.In the next section, the family used to compute the center is (γ R , ϕ R ), because this one has better results than the center computed with (γ R 2 , ϕ R 1 ).

EXPERIMENTS AND RESULTS
In this section the proposed method is evaluated and compared in terms of quality and execution time with other algorithms that include SMF, DBAIN, AMF and NAFSM, using the Lena's image of 510 × 510 size degraded with different noise levels ranging from 10% to 90% with increments of 10%.The restoration quality of the image is measured with the structural similarity index (SSIM) (Wang et al., 2004), a metric that was designed to improve traditional metrics such as PSNR and MSE.The results of the evaluation are presented and compared in table 1 and figure 5. Table 3 shows the qualitative results of the application of these methods.Lena's image in different sizes was used to compare the execution time of the different methods mentioned above, the results are presented in table 2. MATLAB 2017a on a PC equipped with 2.5-GHz CPU and 12 GB of RAM memory has been employed for the evaluation of computation time of all algorithms.To study the robustness of our method, we considered a collection of 10 different images, Fig. 6, which were contaminated with impulsive noise from 40% to 90% intensity and filtered with the 5 filters applied before.The results are presented in table 4.

RESULTS
As seen in figures 1, 2 and 4, the classic morphological filters are effective when the noise level is low, however, if the noise level increases the results of these filters are of low quality.From table 1 and Fig. 5 we can see that the proposed filter is effective and, unlike classical morphological methods, or adaptive, the filter remains stable by increasing noise levels.We also observed that when the noise level is above 50% the results of our filter are better compared to other state-of-the-art filters such as SMF, DBAIN, AMF and NAFSM.
From table 4 we can see that with images like those of Barbara and Einstein the NAFSM method has better results than the proposed method, and with images like walk bridge or jet plane the proposed method is better.Nevertheless, from noise level 50%, in the average case our method was always the best, see figure 7.
In table 2 it can be seen that both SMF method and proposed method have the best execution time.In addition, the proposed method also has the best results with regard to the restoration quality, therefore the proposed method has the best results with respect to the time-quality ratio.
defined as f r ∈ F affected by impulsive noise where a fraction p ∈ [0, 1] of the points in the domain of f , which are randomly selected with uniform probability, change their value by the following composition, f r (x) = τ(ρ(1) ≤ p, τ(ρ(1) ≤ 0.5, 0, L), f (x))

Fig. 1 :
Fig. 1: From left to right.Up to down.first column: images with impulsive noise of 10% and 30%; second column: morphological filter γ B ϕ B γ B ; third column: morphological filter ϕ B γ B ϕ B .B is the diamond-shaped structuring element.

Fig. 2 :
Fig. 2: .From left to right.Up to down.First column: images with impulsive noise of 10% and 30%; second column: morphological center C( f ) where B is the diamond-shaped structuring element.

Fig. 3 :
Fig.3: From up to down.Left to right.first row: noisy image and estructuring elements Z(x) for some pixels marked with an x.Second row: reflected estructuring elements Ẑ(x) for some pixels marked with an x, and the resulting image δ Ẑ f .

Fig. 6 :
Fig. 6: Images.Up to down.From left to right.First row: Baboon, Barbara, Cameraman, Einstein and Hill; second row: House, Jet plane, Lake, Ship and Walk bridge.

Table 1 :
SSIM values for various filters applied on Lena's image at noise density levels from 10% to 90%.

Table 2 :
Execution times for Lena image in different sizes contaminated with noise levels of 40% to 90%.The best results were highlighted.

Table 3 :
From left to right: First column: Lena images at noise density levels of 50% to 90%.; second column: SMF; third column: DBAIN; fourth column: AMF; fifth column: NAFSM and the proposed method.