1 Introduction

Image enhancement algorithms are used to increase the visibility of images for their specific applications. A good number of methods are available in the literature for enhancing different properties or components of images [1, 2]. Contrast enhancement techniques can be classified into intensity-based techniques and feature-based techniques. Intensity-based techniques can be modeled using the relation (see Eq. 16.1)

$$I^{\prime}\left( {x,y} \right) = f\left( {I\left( {x,y} \right)} \right)$$
((16.1))

where \(I\left( {x,y} \right)\) is the original image and \(I^{\prime}\left( {x,y} \right)\) is the output image after enhancement and \(f\) is the transformation function applied to the whole image. Contrast stretching [2], histogram equalization [3] are the popular members within this category. Histogram equalization is a widely accepted image enhancement technique. Variations of this algorithm like bihistogram equalization [4], multipeak histogram equalization [5], adaptive histogram equalization are also available in the literature. Adaptive histogram equalization (AHE) [6] is the widely accepted version of histogram equalization which overcomes the pitfalls of general histogram equalization. The objective of feature-based enhancement technique is to enhance the high-frequency component or the image details of a poor-contrast image. Feature-based methods can be expressed using the relation

$$I^{\prime}\left( {x,y} \right) = L\left( {x,y} \right) + \lambda .H\left( {x,y} \right)$$
((16.2))

where \(L\) and \(H\) represent the low-frequency and high-frequency components, respectively. λ is the enhancement gain or amplification factor required for amplifying the high-frequency components of the image for better perception.

1.1 Linear unsharp masking

Linear unsharp masking (UM) [1] is an important scheme in the feature-based image enhancement category. In the UM technique, a high-pass filtered scaled version of the original input image is added to itself as shown in Fig. 16.1 to obtain an enhanced version.

Fig. 16.1.
figure 16_1_150511_1_En

Simple linear unsharp masking

Although this simple method works well in many applications it suffers a major drawback which limits its performance in certain applications. There is every possibility that the noise is also amplified along with the edge and detail features of the image since we are using a scaled version of the high-frequency components of an image. So the objective is to remove impulsive noise followed by applying unsharp masking while preserving edge details. In our proposed scheme we use a FLANN to determine impulse noise threshold so that we can apply selective filtering on the noisy pixels only and prevent unnecessary loss of image details.

In what follows the detail of the proposed scheme along with the algorithm is presented in Sect. 16.2. Adaptive threshold selection using CV is discussed in Sect. 16.3. Finally, Sect. 16.4 presents the simulation results and Sect. 16.5 gives the concluding remarks.

2 Proposed scheme

The proposed scheme consists of impulse detection and iterative filtration followed by image contrast enhancement as shown in Fig. 16.2.

Fig. 16.2.
figure 16_2_150511_1_En

Proposed model for image contrast enhancement

2.1 Impulse detection

Images are frequently contaminated by impulsive noise due to noisy sensors or channel transmission errors [1,2]. Since use of high-pass filter in unsharp masking (UM) [1] the scheme becomes highly sensitive to noise. There are many types of impulsive noise. Let \(X_{i,j}\) be the gray level of an original image \(X\) at pixel location \(\left( {i,j} \right)\) and \(\left[ {n_{\min } ,n_{\max } } \right]\) be the dynamic range of \(X\). Let \(Y_{i,j}\) be the gray level of the noisy image \(Y\) at pixel \(\left( {i,j} \right)\), and then the random-valued impulsive noise may be defined as

$$Y_{i,j} = \begin{cases}X_{i,j} & \text{with probability} 1 - p \\ R_{i,j} & \text{with probability} p\end{cases}$$
((16.3))

where \(R_{i,j} \in \left[ {n_{\min } ,n_{\max } } \right]\) and \(p\) is the noise ratio. Whereas for fixed-valued impulsive noise (better known as salt and pepper noise)\(R_{i,j} \in \left\{ {n_{\min } ,n_{\max } } \right\}\). It is usually seen that removal of salt and pepper noise is easier in comparison to RVIN since behavior of RVIN pixels and its surrounding pixels is very similar. In this chapter we focus only on random-valued impulsive noise where \(Y_{i,j}\) can be of any value from \(n_{\min }\) to \(n_{\max }\).

In the proposed scheme an impulsive noise detector based on second-order difference is used to determine the threshold for impulse noise detection. Median filtration is performed selectively based on the decision of the threshold. The following mathematical formulation describes whether to filter or to skip a pixel located at \(\left( {i,j} \right)\) of a test window:

$$\hat Y_{i,j} = \begin{cases}Y_{i,j} & d_{i,j} = 1 \\ Z_{i,j} & d_{i,j} = 0\end{cases}$$
((16.4))

where \(Z_{i,j}^{} =\) median \(\left\{ {Y_{i - k,j - l} ,(k,l) \in W} \right\}\) and \(W\) is a predetermined window, usually of size 3×3 or 5×5 [2]. The filtration is performed selectively based on the decision index \(d_{i,j}\) which controls the filtering operation.

Algorithm

Pass one

  1. 1.

    Choose a test window \(Y^{(T)}\) of size \(3 \times 5\) centered at \((i,j)\) of \(Y\) Choose a sub window \(Y^{(W)}\) of size \(3 \times 3\) centered at \((i,j)\) of \(Y^{(T)}.\)

  2. 2.

    Compute the first-order \(3 \times 4\) difference matrix \(fd.\)

    $$fd_{i + k,j + l} = Y_{i + k,j + l}^{(T)} - Y_{i + k,j + l - 1}^{(T)}$$
    ((16.5))

    where \(k = - 1{\rm{, }}0{\rm{, }}1\) and \(k = - 1{\rm{, }}0{\rm{, }}1{\rm{, }}2\)

  3. 3.

    Compute the second-order \(3 \times 3\) difference matrix \(sd\) from \(fd.\)

    $$sd_{i + r,j + s} = fd_{i + r,j + s + 1} - fd_{i + r,j + s}$$
    ((16.6))

    where \(r = - 1{\rm{, }}0{\rm{, }}1\) and \(s = - 1{\rm{, }}0{\rm{, }}1\)

  4. 4.

    Compute the decision parameter \(d\)

    $$d_{i,j} = \begin{cases}0 \hfill & {{\rm{if }}\left| {sd_{i,j} } \right| > \theta _1 } \\ 1 & {{\rm otherwise}}\end{cases}$$
    ((16.7))

    If \(d_{i,j}\) is zero, replace the \(Y_{i,j}\) pixel with the median value of its neighborhood, otherwise leave it as it is.

  5. 5.

    Repeat the above steps for each window from top-left to bottom-right corner of the noisy image.

Pass two

The window \(Y^{(T)}\) selected is of size \(5 \times 3\) centered at \(\left( {i,j} \right)\) of \(Y\) and sub window \(Y^{(W)}\) of size \(3 \times 3\) centered at \(\left( {i,j} \right)\) of \(Y^{(T)}.\) The first-and second-order differences are calculated in vertical fashion and the decision index is determined, followed by selective filtration similar to the steps described earlier. The threshold values taken here in this pass is \(\theta _2.\) The threshold values \(\theta _1\) and \(\theta _2\) are obtained using FLANN as described in Sect. 16.3.

All the steps in the second iteration are repeated for each test window column wise from top-left to bottom-right corner of the image obtained from pass one. Then we perform image enhancement as described in Sect. 16.2.2.

2.2 Image contrast enhancement

The filtered image output \(\hat Y_{i,j}\) is fed into a high-pass filter to separate the high-and low-frequency components. We can choose a suitable gain factor for amplification of image detail regions like sharp edges depending on the application. So this can be represented using the relation given as follows:

$$Y^{\prime}_{i,j} = \hat Y_{i,j} + \lambda H_{i,j}$$
((16.8))

where \(H_{i,j}\) is the output of a linear high-pass filter (see Eq. 16.9).

$$H_{i,j}^{} = 4\hat Y_{i,j} - \hat Y_{i - 1,j} - \hat Y_{i + 1,j} - \hat Y_{i,j - 1} - \hat Y_{i,j + 1}$$
((16.9))

\(\lambda\) is the positive gain factor that controls the level of enhancement required by an application, this may vary from one application to other. Using the proposed filtering scheme we are able to preserve the image edge and detailed features. Adaptive histogram equalization (AHE) technique is further applied on \(Y^{\prime}_{i,j}\) for better visual perception to obtain the desired image \(Y^{\prime\prime}_{i,j}\).

3 Adaptive threshold selection

Artificial neural networks (ANN) has emerged as a powerful learning technique to perform complex tasks in highly nonlinear dynamic environments. Once trained under supervision, the ANN has the capability to generalize and predict the output for any given input in similar type of problems [7]. Numerous structural variations of ANN are available in the literature [8]. A variation of ANN is the functional linked artificial neural network (FLANN), which is a flat net without any hidden layers [8, 9]. The advantage of using a reduced neural network like FLANN is less costly and faster in operation. Training of FLANN by BPA is very simple having lesser computational load and faster convergence rate. The functional expansion increases the dimension of the input vector that in turn improves discrimination capability of the hyper planes generated by the FLANN.

The proposed impulsive noise detector is shown in Fig. 16.1, which is a two-layered structure. The input to the network is a global coefficient of variance (CV) [1] of the noisy image calculated using the relation (see Eq. 16.10)

$${\rm{CV}} = \sigma /\mu$$
((16.10))

\(\sigma\), \(\mu\) are the global standard deviation and mean, respectively, of the image. The input CV is functionally expanded in the input layer with the trigonometric polynomial basis function (see Eq. 16.11).

$$\begin{array}{l} 1,\sin \left( {\pi CV} \right),\sin \left( {2\pi CV} \right),...,\sin \left( {N\pi CV} \right), \\ CV,\;\cos \left( {\pi CV} \right),\cos \left( {2\pi CV} \right),...,\cos \left( {N\pi CV} \right) \\ \end{array}$$
((16.11))

In order to determine the error we compare the actual output of the network with the desired output. As per the error value we update the weight matrix between input and output layers using back propagation algorithm.

We take an image say pepper that is corrupted with impulsive noise of noise density between 0.01 and 0.30 in steps of 0.05. Each corrupted image is subjected to the proposed filter varying the threshold from 0 to 1 in steps of 0.01 and the corresponding mean squared error (MSE) value is computed using Eq. (16.12).

$${\rm{MSE}} = \frac{1}{{MN}}\sum\limits_{x = 1}^M {\sum\limits_{y = 1}^N {\left( {f\left( {x,y} \right) - \hat f\left( {x,y} \right)} \right)} }$$
((16.12))

where \(\left( {M \times N} \right)\) is the size of the image \(X_{i,j}\) and \(Y_{i,j}\), which represents the pixel values at \(\left( {i,j} \right)_{^{th} }\) location of original image and restored image, respectively. The minimum MSE and the corresponding threshold value called optimum threshold \(\left( {\theta _{optimum} } \right)\) are recorded. Since the MSE requires the original image for computation we cannot use it for threshold detection in real-time applications. Here we use CV in place of mean and variance which can be easily computed from the noisy image available and is used for threshold prediction using a FLANN (Fig. 16.3).

Fig. 16.3.
figure 16_3_150511_1_En

FLANN structure for adaptive threshold selection

For training the FLANN the input–output patterns \(\left( {\left( {CV} \right) \to \theta _{Optimum} } \right)\) for different noise levels are generated for different images like Lena, Lisa, Boat, etc. The training convergence for functional link artificial neural network (FLANN) is shown in Fig. 16.4.

Fig. 16.4.
figure 16_4_150511_1_En

Convergence characteristics of FLANN

4 Simulation results

The superiority of the proposed scheme is demonstrated by conducting two experiments. Peak signal-to-noise ratio (PSNR) in dB, as defined in Eq. (16.13) is the metric used to compare the noise removal capability of the proposed scheme with the existing schemes.

$${\rm{PSNR}} = 10\log _{10} \left( {{{255^2 } \mathord{\left/ {\vphantom {{255^2 } {{\rm{MSE}}}}} \right. \kern-\nulldelimiterspace} {{\rm{MSE}}}}} \right)dB$$
((16.13))

where MSE is the mean squared error as defined in Eq. (16.12). Subjective results for Lena, Boat, and Pepper are shown for comparing image enhancement procedure.

4.1 Experiment I

Lena image is corrupted with noise ranging from 0.01 probability to 0.30. Various standard schemes like progressive switching median(PSM) [10], adaptive center weighted median filter (ACWMF) [11], two-pass (2-pass) [12], switching median (SWM(5\(\times\)5)) [13], accurate noise detector (AND) [14], two-output nonlinear filter (2-OUTPUT) [15], median rational hybrid filter-II (MRHF2) [16], detail preserving impulsive noise removal (DPINR) [17], median rational hybrid filter-II (MRHF2) [18], impulse detection based on pixel-wise MAD(PWMAD) [17], FLANN-based adaptive threshold selection for detection of impulsive noise in Images (FLANN-ATS) [19] are simulated along with the proposed scheme. PSNR obtained from various schemes for Lena image are plotted and shown in Fig. 16.5. Table 16.1 depicts the comparative study of PSNR values for standard images, viz. Lena, Lisa, Boat, and Clown, that the performance of the proposed noise removal scheme is superior to existing schemes.

Fig. 16.5.
figure 16_5_150511_1_En

PSNR obtained from various schemes for Lena image

Table 16.1. Comparative results in PSNR (dB) of filtering images corrupted with 15% of noise

4.2 Experiment II

To visualize the subjective image enhancement performance, the enhanced Lena, Boat, Pepper images are compared with the results of the simple linear unsharp masking [1] and is shown in Fig.16.6. Since we do not have any quantitative evaluation measure for image enhancement because of absence of any ideal image we are forced to go for subjective evaluation. And it can be easily realized that since we are not amplifying the noise and also preserving the image details while filtering the proposed method is much better in comparison to simple unsharp masking. Further we apply AHE for better visual perception. So the proposed scheme gives better performance in comparison to simple unsharp masking.

Fig. 16.6.
figure 16_6_150511_1_En

Subjective comparison of enhanced images for Lena, Boat, and Pepper

5 Conclusions

This chapter has proposed a novel filtering scheme for suppressing impulsive noise from contaminated images along with provision for better image contrast. Since we are using selective median filtering this scheme is able to preserve the image details for further image enhancement after impulse noise removal. Through exhaustive computer simulations it is observed that the proposed scheme exhibits superior performance over other schemes.