A Detail Preserving Vector Median Filter Based on Texture Analysis

. A texture detail preserving vector filter is proposed to remove impulsive noise in color images. By computing the texture complexity of the local neighborhood centered at each pixel according to the texture analysis of the color image, the proposed method classifies the local neighborhood into smooth region or texture one. For smooth regions and texture regions, different smoothing strategies are performed. For a smooth region, more smoothing is needed, whereas for a texture region the amount of smoothing should be controlled by its texture complexity. Experimental results show that the proposed method obviously outperforms the classical VMF both in noise suppression and in texture and detail preservation.


Introduction
Images are frequently corrupted by impulse noise, which rapidly reduce image quality, and destroy image structure of texture and details. Median filter has become the most popular method to remove impulse noise in color images (Plataniotis et al., 2000), including vector median filter (VMF) (Astola et al., 1990), basic vector directional filter (BVDF) (Trahanias et al., 1993), and Distance-directional filter (DDF) (Karakos et al., 1997). They sort the vectors of pixels in the filter window using different color distances, such Euclidean distance, angle distance and mixture of Euclidean and angle distance, then select the minimum distance as the output of filter. These vector median filters is highly effective in removing impulsive noise from color images. However, it tends to smooth image textures and details, especially when noise contamination is high. This is because VMF performs the same smoothing on all pixels without consideration of image local structures. So many improved vector median filters are proposed. Switching vector median filters (SVMF) (Smolka et al. 2005 andMalinski, et al., 2006) and weighted vector median filters (Li et al., 2006 andJin, et al., 2008) are two typical classes of vector median filters.
This paper improves VMF based on local texture analysis, and implements a texture-presevered vector filter. The proposed method first computes the texture complexity of the local neighborhood centered at each pixel according to the texture analysis of the color image. Then, the local neighborhood is classified into smooth region or texture one. Finally, the central pixel in the local neighborhood is smoothed by traditional VMF or weighted VMF, depending on the local neighborhood is smooth region or texture one. Experimental results show that the proposed method obviously outperforms the classical VMF both in noise suppression and in texture and detail preservation.
For the pixel k x in the window , calculate the sum of the vector distances ( 2 L norm) from it to other pixels in the windows firstly: (2) In this paper, 2 L norm (Euclidian distance) is used. Then sort 1 D , 2 D ,…, N D values in ascending order and find the smallest one among all the i D values. Finally, the corresponding pixel (1) x of the smallest distance (1) D is the output of VMF, that is the central pixel of the window is replaced with (1) x .
Weight vector median filter (WVMF) performs better in noise suppression and detail preservation than classical VMF. Different weights are assigned to pixels in the window, and pixel which are not corrupted or more similar to original pixels should be assigned higher weights.

Proposed detail preserving vector median filter
The proposed method performs maximum smoothing in the smooth region and less smoothing in the texture region to realize detail preservation. So the texture complexity of the pixel in a local region needs to be computed firstly. Different texture complexity methods have been developed. This paper employs edge information to measure texture complexity. The more edge pixels in a local region, the larger texture complexity of the region should be. However, due to the vector nature, extraction of edges from color images is more challenging than from grayscale images. There are different methods to detect color image edges. For simplicity, this paper uses the edges in luminance image, since human vision is highly sensitive to luminance compared to chromaticity (Ruttiger et al., 2000). We use the Canny edge operator to detect edges in luminance image (Canny, 2000). And () e x,y denotes the edge image: x y is an edge point e x,y otherwise Let the size of the local region for computing the texture complexity is KK  . If the pixel () x,y locate in the texture region, then there are some edges crossing the region  where () x,y is the central pixel. Typically, there are one or two edges crossing the region. So the texture complexity is computed by The pixel in edge texture region is smoothed by weighted VMF, and others are smoothed by traditional VMF. In other words, if the pixel located in the smooth region ( ( ) 1 x,y   ) or in the texture region ( ( ) 1 x,y   ) but is not an edge pixel, we use traditional VMF to smooth. Otherwise, for the edge pixels in the texture region, we use weighted VMF to perform. This paper uses Gaussian weighting function in the weight vector median filter: We can use the value of () x,y e to judge the pixel () x,y is or not located in the edge. However, there are always offset between the actual edge pixel and the detected edge pixel in the process of edge detection, which offset is always one or two pixels.
So this paper denotes the pixel () x,y is an edge pixel if there is at least one edge pixel in its 55  neighbourhood region.
Then output of the proposed detail preserving vector median filter is given by It can be seen from the above equations that in smooth regions the maximum smoothing by traditional VMF will be performed, whereas in texture regions, less smoothing introducing by WVMF, which is determined by parameter , is carried out. Thus, texture preservation is implemented.

Experimental Results
The objective evaluation measures, PSNR (peak signal-to-noise ratio), MAE (mean absolute error), and NCD (normalized color difference) are used to represent the quality of different filters (Plataniotis et al., 2000). The PSNR and MAE are used to measure the performance of noise suppression and structural content (edges, textures, and fine details) preservation, respectively, whereas the NCD is used to quantify the color distortion.
In the proposed algorithm, four tuning parameters , , and 1  and 2  need to be fixed. They are set as follows:  (filter window size) is 3x3, (neighborhood size for computation of texture complexity) is 7x7, and 1 1   and 2 0.8   (used for WVMF in the Gaussian weighting function). Note that when computation of edges, the color image is preprocessed by 3x3 VMF. The proposed method has been evaluated by an extensive range of tests. Figure 1 shows two test color images, "Lena" and "Parrots" with size of 256 256  . And the performance of the proposed method is compared with VMF, BVDF and DDF. Table  1 and Table 2 list the experimental results of VMF, BVDF, DDF and the proposed method for Lena and Parrots with noise ratio (NR) of 5%、10%、20%、30%, respectively. It is seen that the proposed method significantly outperforms VMF, BVDF, DDF in terms of all the three criteria. It do well in noise suppression (see PSNR measure), and is effectively in texture and detail preservation (see MAE measure), and preserve color hue (see NCD measure). Figure 2 show the filter images of Parrots with 20% noise ratio which are smoothed by VMF, BVDF, DDF and the proposed method respectively. It can be seen that the proposed method is effective both in noise suppression and in texture and detail preservation.
Furthermore, to get a better look at the filter image details, Figure 3 shows the amplification of a part of the filtered image of Lena with 10% noise. Obviously, the proposed method preserves well the image details, especially the parts of the eyes and the hair.

Conclusions
A detail preserving vector median filter for removal of impulse noise from color images is proposed in this paper. First, by analyzing the edge map of a color image, the original image pixels are classified into texture pixels and non-texture ones. Then, for texture pixels, a weighted VMF is performed, which results in less smoothing in denoising the texture pixels and thus the textures and details are effectively preserved. For non-texture pixels, the traditional VMF is carried out, which ensures that maximum smoothing is performed and thus the smoothness of the non-texture pixels are kept. By this way, the proposed texture-preserved vector filter is implemented. Experimental results indicates the superiority of the proposed method by showing significant performance gains both in noise reduction and detail preservation, compared to the traditional VMF.