Keywords

1 From Heat Equation to Anisotropic Diffusion

Since 1960, digital images may simply be deblurred by combining the difference between an original image \(I_0\) and \(\varDelta I\): a blurred version of this same image. Usually, \(\varDelta I\) corresponds to a blur process equivalent to the heat equation or a convolution of \(I_0\) with an isotropic Gaussian. This original theory proposed by Gabor is proportional to using the Laplacian operator [7]. Thus, a simplest manner to remove blur in an image remains the equation:

$$\begin{aligned} \frac{\partial I }{\partial t} = I_0 -\alpha \cdot \varDelta I, \end{aligned}$$
(1)

where t represents the time or the observation scale and \(\alpha < 1\) is a little scalar to control the deblurring. This process is equivalent to the inverse heat equation. However, this technique is not stable because the procedure blows up after several iterations and generates an unusable image [7]. To improve Eq. 1, rather than applying a global operator on all the image, the main idea is to iterate local operator at level of each pixel. Nonlinear Partial Differential Equations (PDEs) may achieve this task [2, 7], practicing anisotropic diffusions of pixel informations in the image. Indeed, PDEs belong to one of the most important part of mathematical analysis and are closely related to the physical world. In this context, images are considered as evolving functions of time and a regularized image can be seen as a version of the original image at a special scale.

2 On Existing Shock Filters

The main PDEs for image deblurring are presented in this section. In order to regularize images by controlling the diffusion, the pioneer work of Perona and Malik on anisotropic diffusion has been one of the most influential paper in the area [17]. The proposed model is described by the following equation:

$$\begin{aligned} \frac{\partial I}{\partial t} (x, y , t) = \text {div} \left( g\left( | \nabla I| \right) \cdot | \nabla I | \right) , \end{aligned}$$
(2)

where \(|\nabla I|\) represents the modulus of the gradient with mask of type [−1 1] and g a decreasing function satisfying \(g(0) = 1\) and \(g(+\infty ) = 0\); this function may be:

$$\begin{aligned} g\left( | \nabla I| \right) = \displaystyle e^{-\left( \frac{| \nabla I |}{K}\right) ^{2}}, \end{aligned}$$
(3)

with \(K \in \mathbb {R^+_*}\) a constant that can be assimilated to a gradient threshold or a diffusion barrier, slowing down diffusion near edges, where \(|\nabla I|\) is large. Moreover, by developing Eq. 2, it is well known that the diffusion moves backward when \(|\nabla I| > K\), creating time-reverse equation (deblurring effect) called a shock filter.

Original Shock Filter: In the PDE framework, the seminal contribution [16] is equivalent to Eq. 1, the 2D formulation of the original shock filter is:

$$\begin{aligned} \frac{\partial I}{\partial t}=-\text {sign}(\varDelta I)\cdot | \nabla I |. \end{aligned}$$
(4)

This PDE produces a dilation/erosion for each pixel, creating a high sensitivity to noise pixels, so a number of improvements have been proposed.

Shock Filter Involving Gaussian: In order to be more robust to noise, the Gaussian function \({{G}_{\sigma }}\) may be convolved with \(I_{\eta \eta }\), the second directional derivative of the image in the gradient direction, where \(\sigma \) represents the standard deviation of the Gaussian. Coupling diffusion (\({I}_{\xi \xi }\) term [2, 7, 13, 19]) and shock filter, Alvarez and Mazorra (AM) in [3] proposed the following equation:

$$\begin{aligned} \frac{\partial I}{\partial t} = C_\xi \cdot I_{\xi \xi } - sign(G_\sigma *I_{\eta \eta }) \cdot | \nabla I |, \end{aligned}$$
(5)

where \(|\nabla I|\) is the modulus of the gradient with a 3\(\times \)3 mask (as Sobel masks), \(C_\xi \) denotes a control function of the diffusivity, as in Eq. 3, \(I_{\xi \xi }\) denotes the second derivative in the orthogonal direction of \(\eta \), i.e., the edge direction. It corresponds to a pure diffusion in the contour directions, called the curvature equation.

Some evolutions of this approach have been proposed, as in [8], where an isotropic diffusion (\(\varDelta I\)) is applied concerning small gradients. Fu et al. [5] proposed a PDE technique that weights the diffusion and shock terms in accordance with threshold values of the gradient magnitude:

$$\begin{aligned} \left\{ \begin{array}{ll} \frac{\partial I}{\partial t} = &{} c_1 \cdot I_{\xi \xi } - \text {sign}(G_{\sigma } * I_{\eta \eta }) \cdot |\nabla I| , \;\; \quad \quad \text {if} \; | \nabla I |> T_1 \\ [.5ex] \frac{\partial I}{\partial t} = &{} c_1 \cdot I_{\xi \xi } - c_2 \cdot \text {sign}(G_{\sigma } * I_{\eta \eta }) \cdot |\nabla I|, \quad \text {if} \;\, T_1> | \nabla I | > T_2 \\ [.5ex] \frac{\partial I}{\partial t} = &{} \varDelta I = \; I_{\xi \xi } + I_{\eta \eta } \quad \quad \quad \quad \quad \quad \quad \quad \quad \text {elsewhere,} \end{array}\right. \end{aligned}$$
(6)

with \(c_1 = \frac{1}{1+{{\zeta }_{1}} \cdot I_{\xi \xi }^{2}}\), (\(\zeta _1 \in \mathbb {R^+}\)), and \(c_2= |\text {th}({{\zeta }_{2}} \cdot {{I}_{\eta \eta }})|\), (\(\zeta _2 \in \mathbb {R^+}\)). The authors divided the image into three-type regions by its smoothed gradient magnitude. For high gradients (generally boundaries), a shock-type backward diffusion is performed in the gradient direction for the deblurring. For medium gradients (such as textures and details), a soft shock-type backward diffusion is performed, as Eq. 5. As far as small gradients are concerned(such as inside different areas or flat regions), an isotropic diffusion is applied (heat equation).

On the other hand, Bettahar [4] proposed a combination of nonlinear reaction-curvature diffusion and shock filter. The gradient modulus of \(f(s) = f \frac{1}{1 +{s^2}/{k}}\) applied on the gradient magnitude \(|\nabla (f(|\nabla I_\sigma |))|\) favors or inhibits the shock filter in accordance with the gradient magnitude.

The main problem of the based-Gaussian models is the creation of homogeneous blobs in flat noisy regions, as illustrated in Figs. 1(b), 5(b) and  6(b). Moreover, after a certain number of iterations a corner smoothing could be created, as show for the extremity of the star in Fig. 5(b).

Complex Shock Filter: A different solution proposed by Gilboa et al. [6] is to change the sign function (cf. Eq. 4) in order to take into account both the 2nd order direction of the second derivative and its magnitude. Denoting Im(I), the imaginary part of I, by using \(\frac{2}{\pi } \text { arctan}(a \cdot Im(\frac{I}{\theta }))\), \(a\in \mathbb {R^+}\) represents the parameter controlling the steepness of the slope of the 2nd order derivative near 0. When \(\theta \in \mathbb {R^+_*}\) tend to 0, \(Im(\frac{I}{\theta })\) may be considered as the smoothed 2nd order derivative of I. The complex shock filter is described by the following equation:

$$\begin{aligned} \frac{\partial I}{\partial t} =-\frac{2}{\pi }arctan(a \cdot Im(\frac{I}{\theta })) \cdot |\nabla I|+\varLambda \cdot I_{\eta \eta }+\tilde{\varLambda } \cdot I_{\xi \xi }, \end{aligned}$$
(7)

where \(\varLambda \) is a complex diffusion term regularizing the noise and indicating inflection points. \(\tilde{\varLambda }\) is a real scalar parameter which correspond to the amount of diffusion in level-set direction. Using Eq. 7, the regions close to contours where the 2nd order derivative has a higher magnitude, i.e., inflection points will not have equal weights. This translates into a higher deblurring speed near edges and contours than in the flat regions of the image.

The complex shock has been improved in [9] to correct its main default: a weak edges enhancement. Denoting \( \frac{\partial I}{\partial t} = I_t\) and Re(I) the real part of I, the mathematical expression of this PDE can be decomposed in two expressions:

$$\begin{aligned} Re(I_t)= & {} \frac{2}{\pi }arctan(a.Im(\frac{I}{\theta })).f_{1}\cdot |\nabla I| -sign(Re(I_{\eta \eta })).f_{2}\cdot |\nabla I| \nonumber \\&+ f_1\cdot (Re(\varLambda ) \cdot Re(I_{\eta \eta }) - Im(\varLambda ) \cdot Im(I_{\eta \eta })+\tilde{\varLambda } \cdot Re(I_{\xi \xi })) \end{aligned}$$
(8)
$$\begin{aligned} Im(I_t)= & {} Im(\lambda ) \cdot Re(I_{\eta \eta })-Re(\lambda ) \cdot Im(I_{\eta \eta })+\tilde{\varLambda } \cdot Im(I_{\xi \xi }). \end{aligned}$$
(9)

As this filter is an improvement of the Eq. 7, it possesses the same variables. However the 2 new functions \(f_1\) and \(f_2\) are the filter core, and control the transition between an entirely complex and an entirely real filter. For N iterations, they are define as: for \( i=0,1,...,N-1\) and \(T_{l_1},T_{s_1},T_{l_2},T_{s_2} \in (0,N-1)\),

$$\begin{aligned} f_1(T_{l_1}, T_{s_1})= \left\{ \begin{array}{lll} 1,\qquad \quad \quad \,\,\, i<T_{l_1} \\ 1-\frac{i-T_{l_1}}{T_{s_1}-T_{l_1}}, \, \text {elsewhere,} \\ 0,\qquad \quad \quad \,\,\, i>T_{s_1} \end{array} \right. \,\,\, f_2(T_{l_2}, T_{s_2})= \left\{ \begin{array}{lll} 0,\qquad \,\,\,\,\, i<T_{l_2} \\ \frac{i-T_{l1}}{T_{s_2}-T_{l_2}},\, \text {elsewhere.} \\ 1,\qquad \,\,\,\,\, i>T_{s_2} \end{array} \right. \end{aligned}$$

When \(f_1 = 1\) and \(f_2 = 0\) this technique behaves exclusively as a complex shock filter. In the case where \(f_1 = 0\) and \(f_2 = 1\) it correspond to an edge enhancement filter by using the classic shock filter. Elsewhere, it corresponds to a mix of both.

Despite the originality of complex shock filter and its evolutions, the main drawback of this techniques concerns noisy images. Namely, in the presence of noise, the deblurring process creates images looking grainy a level of edges (cf. Sect. 4). In other words, edges are not straight, but rather serrated boundaries.

Fig. 1.
figure 1

Restoration of a real highly noisy image.

Structure Tensor Based Approaches Shock Filter. The coherence enhancing shock filter has been developed by Weickert [22] with the shock filter theory via structure tensor based approach. Thus, the corresponding PDE:

$$\begin{aligned} \frac{\partial I}{\partial t} =-sign((G_\sigma *I)_{\omega _+\omega _+})\cdot |\nabla I| \end{aligned}$$
(10)

allows shock filtering along the direction of the eigenvector \(\omega _+\) corresponding to the largest eigenvalue of the structure tensor: \( J_\rho (\nabla I_\sigma )=G_\rho *(\nabla I_\sigma \cdot \nabla I_\sigma ^T), \) where the parameters \(\rho \) and \(\sigma \) represent standards deviations of the Gaussian.

Tschumperlé and Deriche proposed a different form of the diffusion shock filter coupling especially for enhancement of color images [19]. This model can be generalized to gray level images using the structure tensor:

$$\begin{aligned} \frac{\partial I}{\partial t} =\alpha \cdot (I_0 - I) + c_{\omega _-} \cdot I_{\omega _- \omega _-} + c_{\omega _+} \cdot I_{\omega _+ \omega _+} - (1 - g(\mathcal{N}))\cdot sign((G_\sigma *I)_{\omega _+\omega _+}) \cdot |\nabla I| \end{aligned}$$
(11)

where \(\alpha \in \mathbb {R^+_*}\), and \(c_{\omega _{+/-}}\) are two decreasing functions: \(c_{\omega _-}(\mathcal{N}) = \frac{1}{\sqrt{1 + \mathcal{N}^2}}\) and \(c_{\omega _+}(\mathcal{N}) = \frac{1}{{1 + s^2}}\), with \(\mathcal{N} = \sqrt{\lambda _++\lambda _-}\). The shock is controlled by \(g(\mathcal{N})\) (cf. Eq. 3), where \(\lambda _ +\) and \(\lambda _-\) denote the two eigenvalues tied to the eigenvectors \(\omega _+\) and \(\omega _-\) respectively, related to the tensor \(J_\rho \).

These tensorial techniques behave like a contrast enhancing shock filter, they enhance well strip structures as in Fig. 6(c), however they create artificial lines or may engender an undesirable grainy effect around edges when dealing with highly noisy images, see Fig. 1(c). Notwithstanding a long-term and large scientific effort for PDE-based methods, a satisfactory solution has not been found yet.

3 A New Half Kernel Based Shock Filter

As stated in the methods above, image derivatives \((I_{\xi \xi }, I_{\eta \eta })\), and the gradient are crucial information for the image enhancement via PDEs. The more these features are accurate and robust against noise, the more the diffusion process is efficient. This section presents an oriented half kernels-based technique which enables a gradient computation and an estimation of edge directions modulo 2\(\pi \). Thereafter, these components are useful for the creation of image derivatives and represent fundamental information tuning the proposed PDE.

3.1 Derivative Half Gaussian Kernels

Gaussian kernels are used in a large part of Shock filter for their efficiency in edge detection. Nevertheless weaknesses can be noticed at level of corners and small objects present in the image (as stated above about shock filters involving Gaussians). Edge detection techniques using elongated kernels are efficient at detecting large linear structures correctly [18], but small structures are considered to be noise and their edges are not extracted. Consequently, the accuracy of the detected edge points decreases strongly at corner points and for non-straight object contour parts. To bypass this undesirable effect, an anisotropic edge detection method is developed in [14] and deeper evaluated in [10]. Indeed, the proposed technique is able to detect crossing edges and corners due to two elongated and oriented filters in two different directions. The main idea is to “cut” the anisotropic Gaussian kernel using a Heaviside function (see Fig. 2(c)). The half kernel (HK) can be implemented using Gaussian and its first derivative:

  • a half smoothing part: \(\mathcal{G}(s) = H(s) \cdot \mathbf{e}^{\frac{s^2}{2\cdot \mu ^2}}\), with H the Heaviside function,

  • a derivative part of the filter: \(\mathcal{G}_1(s) = s \cdot \mathbf{e}^{\frac{s^2}{2\cdot \sigma ^2}}\), with \(\sigma , \mu \in \mathbb {R}^*_+ \) and \(s \in \mathbb {R}\).

Fig. 2.
figure 2

Representation of filter supports concerning edges and corners. (c)Derivative Gaussian kernel. (d) 2D half kernel. (d) Selection of points before applying the \(HK_\theta \).

For signal and image processing, s belongs to integers. Figure 2(d) shows an example of a HK, built with the two function \(\mathcal{G}_1\) at the horizontal and \(\mathcal{G}\) at the vertical respectively. In order to create an elongated filter, the support of the half smoothing part must be higher than the derivative support i.e., \(\mu > \sigma \). Then, the HK is rotated in several directions \(\theta \) from 0 to \(2\pi \) (bilinear rotation) to obtain a rotated version of the filter \(HK_\theta \). The convolution of the image I with \(HK_\theta \) (i.e., \(I * HK_\theta \)) allows to compute a derivative information at each desired angle (illustrated in Fig. 2(e)–(f)). In order to better understand this technique to extract edge, the filter support of a HK on a straight contour is equivalent to 1/2 on both sides of the edge, illustrated in Fig. 2(b). On the contrary, for a corner point with a \(\pi /2\) radian angle, the support of the half filter remains 1/2 on both sides of the edge, whereas it is around 1/4 and 3/4 concerning other filter supports [10] (cf. Fig. 2(a)). Eventually, HK corresponds to an oriented filter derivative, so its responses are either positive, or negative. For each pixel of coordinates (xy), the gradient \(|\nabla I|\) corresponds to the maximum value minus the minimum value of \(I * HK_\theta \) among all the \(\theta \) directions:

$$\begin{aligned} \left\{ \begin{array}{clll} |\nabla I|(x,y) &{}=&{} { \text {max}_ {\theta \in [ 0, 2 \pi [ }}{ I * HK_\theta }(x,y) -\!\!{ \text {min}_ {\theta \in [ 0, 2 \pi [ }}{ I * HK_\theta }(x,y) \\ \theta _1(x,y) &{}=&{} {\text {arg} \text {max}_{\theta \in [ 0, 2 \pi [ }}({ I * HK_\theta }(x,y)) \\ \theta _2(x,y) &{}=&{} {\text {arg}\text {min}_{\theta \in [ 0, 2 \pi [ }}({ I * HK_\theta }(x,y)) \\ \eta (x,y) &{}=&{}\frac{\theta _1 + \theta _2}{2} \\ \beta (x,y) &{}=&{} \left\{ \begin{array}{clll} \!&{} \! | \theta _1(x,y) \! -\! \theta _2(x,y) |, \quad \quad \quad \quad \; \text {if} \, | \theta _1(x,y) \!-\! \theta _2(x,y) | \! \leqslant \! \pi \\ \!&{} 2 \pi - | \theta _1(x,y) - \theta _2(x,y) | \quad \quad \text {elsewhere.} \end{array} \right. \end{array} \right. \end{aligned}$$
(12)

Note that the matlab code of the HK is available on mathworks website [11], involving different HK filters. Once \(|\nabla I|\), \(\theta _1\) and \(\theta _2\) have been obtained, \(\eta \) corresponds to the gradient orientation i.e., to the bisector between these two directions, thus the oriented second derivative \(I_{\eta \eta }\) may be created (Fig. 3(d)). Also, as represented in Fig. 4(c), \(\beta \) denotes the angle formed by \(\theta _1\) and \(\theta _2\), corresponding to an angular sector.

These directions are useful and efficient for image restoration via PDE [13], corner detection [1] or image descriptor [20]. All these entities computed via Eq. 12 are required for the proposed shock filter PDE.

3.2 Diffusion Using Directions of Half Gaussian Kernels

Diffusion Along Directions of Edges: PDE-based methods are a mature technique. Therefore, PDE-based image regularization techniques using gradient intensities or tensorial diffusion smooth the image either both in the directions of edges \(\xi \) or \(\omega _-\) and gradient direction \(\eta \) or \(\omega _+\). This process is doable by combining the current diffused image with oriented second derivative of the image (\(I_{\xi \xi }\) and \(I_{\eta \eta }\), see PDE in Sect. 2). However, all these approaches do not take the two directions of edges into account, for example at a level of a corner.

Similar to the curvature equation \(I_{\xi \xi }\), the original idea developed in [12] is to smooth anisotropically at level of edges in two diffusion directions \(\theta _1\) and \( \theta _2\):

$$\begin{aligned} \frac{\partial I}{\partial t} = \frac{\partial ^2 I}{\partial \theta _1 \partial \theta _2} = I_{\theta _1 \theta _2}. \end{aligned}$$
(13)

In [12], the two directions necessary for the diffusion are not computed by derivative half Gaussian kernels, only the diffusion process imports here. Indeed, contrary to previous methods, \(I_{\theta _1 \theta _2}\) is computed by interpolations in the \(\theta _1\) and \( \theta _2\) directions, from 0 to \(2\pi \), with one and only one direction for each angle. As illustrated in Fig. 4(e), for each pixel, the smoothing is doable in 3\(\times \)3 mask with the two pixels interpolated by the unweighted average in the desired directions. Yet, applying this PDE in an image using \(\theta _1\) and \( \theta _2\) issued from Eq. 12 is not stable and \(I_{\theta _1 \theta _2}\) creates an effect of dilation/erosion close to edge points, because \(\theta _1\) and \( \theta _2\) are not well directed. Figure 3(b) illustrates this undesirable effect.

Fig. 3.
figure 3

A diffusion along \(\theta _1\) and \( \theta _2\) directions creates a blur effect around edges.

Fig. 4.
figure 4

Mirror rotation of \(\theta _1\) and \(\theta _2\) directions to avoid a blurring effect in the diffusion process. (a): Pixel close to an edge. (b-c): Diffusion directions for the selected point.

A Mirror Rotation in Order to Enhance the Diffusion: The PDE presented in Eq. 13 may be controlled by the gradient magnitude, for example, but an undetermined quantity of blur will be created. Consequently, instead of diffusing alongside the directions \(\theta _1\) and \(\theta _2\), it was proposed in [15] to diffuse in the opposite directions, i.e., the directions \(\theta _1^{\pi } = \theta _1 -\pi \) and \(\theta _2^{\pi } = \theta _2-\pi \). Figure 4 illustrates these modifications where \(\beta \) keeps the same value. The new diffusion PDE becomes:

$$\begin{aligned} \frac{\partial I}{\partial t} = \frac{\partial ^2 I}{\partial \theta _1^{\pi } \partial \theta _2^{\pi }} = I_{\theta _1^{\pi } \theta _2^{\pi }}. \end{aligned}$$
(14)

Simply by a mirror effect, this diffusion offers a better preservation than the original as seen in Fig. 3(c), after many iterations without any control (!). Using the original diffusion the white pixels near the border are attracted by the color of the border which causes the appearance of grey blotches. By inverting the direction of the diffusion, those pixels are not attracted anymore and the disk is preserved, while few pixel of noise have disappeared in the middle of the image. The purpose of getting a stable PDE is to control the diffusion of Eq. 14 before developing a new combination with a shock filter scheme.

Fig. 5.
figure 5

Image restoration. For (b), \(\sigma = 1\), (c) \(\sigma = 1\), \(\rho = 3\) and (d) \(\sigma = 1\), \(\mu = 3\).

A Diffusion Tuned by the Gradient and the Directions of Edges: The presented schemes in Eqs. 13 and 14 do not control the diffusion, they correspond to linear models. In other words, the pixel intensities are propagated involving interpolations along (\(\theta _1, \theta _2\)) or (\(\theta _1^{\pi }, \theta _2^{\pi }\)) directions with a constant speed (cf. Fig. 4(e)). In order to avoid an over-smoothing of important parts of the image, as edges and corners, the diffusion must be nonlinear. There are many existing nonlinear models to smooth and restore images via PDEs [2, 7, 13, 17, 19]. The main idea is to smooth extensively inside homogeneous regions, whereas edges must be enhanced. The g function in Eq. 3 represents a good manner to tune the diffusion depending on gradient modulus. Inspired by the model developed in [13], a control function is proposed here to decrease the diffusion both at edge and corner points (when the angle between \(\theta _1^{\pi }\) and \(\theta _2^{\pi }\) is not open: \(\beta <\pi \)):

$$\begin{aligned} C_{(k,h)}(|\nabla I |, \beta ) = \frac{1}{2} \cdot {e^{ -\left( \frac{|\nabla {I}|}{k} \right) ^2} + \frac{1}{2} \cdot e^{ -\left( \frac{(\pi - \beta )}{(\pi \cdot h)} \right) ^2}} \quad \text {with} \quad (k,h) \in \, ]0; 1]^2 \end{aligned}$$
(15)

Thus, Eq. 14 becomes:

$$\begin{aligned} \frac{\partial I}{\partial t} = C_{(k,h)} \cdot I_{\theta _1^{\pi } \theta _2^{\pi }}. \end{aligned}$$
(16)

The smoothing process is driven by the gradient magnitude and \( \beta \). The \(C_{(k,h)} \) function ensures the diffusion preserving edges and corners and enables an extensive smoothing inside homogeneous regions. In case of a small gradient and a \(\beta \) angle close to \(\pi \), the considered pixel will be largely diffused. If the gradient is important and the \(\beta \) angle is small, smoothing is weak and preserves boundaries.

A New Shock Filter Scheme: As stated in Sect. 2, corner rounding is the main weakness of the shock filter. To correct this problem a control function is inserted for the shock filter term, inversely to the control of \(I_{\theta _1^{\pi } \theta _2^{\pi }}\). Thus, Eq. 16 evolves into:

$$\begin{aligned} \frac{\partial I}{\partial t} = C_{(k,h)} \cdot I_{\theta _1^{\pi } \theta _2^{\pi }} - (1 - C_{(k,h)}) \cdot sign(I_{\eta \eta }). \end{aligned}$$
(17)

Consequently, the smoothing process and the shock are both tuned by \(C_{(k,h)}\). When \(|\nabla I| \approx 0\), it corresponds to homogeneous regions, \(C_{(k,h)} \rightarrow 1\), and shock term does not work. If \(\beta \) is a close angle and the gradient is weak, the process must smooth this region; it is doable when \(k > h\) in Eq. 16. When \(|\nabla I| \approx 1\), it refers to pixels of (or close to) contours, \(C_{(k,h)} \rightarrow 0\), thus edges are enhanced. Figure 5(d) illustrates the enhancement of an image containing corners (with \(k = 0.1\), \(h = 0.05\)).

Fig. 6.
figure 6

Comparition of several PDE schemes on a picture of Vincent van Gogh paint. For (b), \(\sigma = 1\), (c) \(\sigma = 1\), \(\rho = 3\) and (d) \(\sigma = 1\), \(\mu = 3\).

Fig. 7.
figure 7

Enlargement of parts extracted from images (a) -left- and (d) -right- in Fig. 1.

4 Experimental Results

Several application results of the proposed PDE are presented in this section. These results are compared to the different approaches described above. The parameters used for all the methods are also detailed. As far as the evaluation process is concerned, the Structural Similarity Index Measure (SSIM) [21] is reported and plotted as a function of the number of iterations for each method.

The parameters for the half kernels are \(\sigma = 1\) for the derivative and \(\mu = 3\) for the smoothing during all the experiments. Such a set of parameters enables an enhancement of small objects and thin structures. With the enlargement of these two parameters, the scale effect will lead only to the enhancement of the large structures or dominant edges. The first result presented in Fig. 5 shows the behavior of the proposed PDE method with an image containing pointed corners. Even though the original image does not contain blur, edges remain sharp after 50 iterations whereas the noise disappears completely. For the second original image in Fig. 6, stripes are created by a brush on a painting. This result is somewhat reminiscent of tensorial approaches [19, 22]. After 50 iterations, results depict the coherence of the proposed PDE scheme because the lineaments, trees and characters are preserved and enhanced. With the same number of iterations, boundaries in the image presented in Fig. 1 are well enhanced while corners are highly improved, as detailed in Figs. 7(b) and (d).

To shed light on the effectiveness of the proposed shock filter, two tested images are noised by adding random Gaussian noise and blurred using a convolution with a Gaussian of standard deviation of \(\sigma =1\), cf. Figs. 8(a)-(b) and 9(a)-(b). Then they are independently treated by Perona-Malik (PM), Alvarez-Mazorra (AM), Gilboa, Luduzan, Fu, Tschumperlé and Bettahar methods. The parameters for methods involving Gaussians is \(\sigma = 1\) and \(\rho = 3\) for tensorial PDEs. For complex shock filters, \(\theta = 0.001\), \(a = 2\) and \(\hat{\lambda } = \lambda = 0.1\). In order to compare objective performance of these approaches, the SSIM is calculated for each iteration; presented images are tied to the best score of the measure. As shown in Figs. 8(c) and 9(c), the SSIM curve of the proposed scheme is above the others (called Half-filter), translating a better image enhancement than other PDE methods. The degraded images contain a strong noise and small objects have to be restored. As an example, the gray structure in the middle of the tripod in Fig. 8(a) is well enhanced by the new filter. Indeed, this object is recognizable and realistic, contours are straight. Details are also enhanced like the camera and the cameraman’s lock of hair. Finally, by using the new PDE, the corners and edges of Fig. 9(b) are well deblurred, without creating a grainy effect around edges.

Fig. 8.
figure 8

Restoration a blurred (\(\sigma = 1\)) and noisy image, 272\(\,\times \,\)272, in (b), SNR = 13.1 dB.

Fig. 9.
figure 9

Restoration a blurred (\(\sigma = 1\)) and noisy image, 256\(\,\times \,\)256, in (b), SNR = 13.53 dB.

5 Conclusion

A new shock-filter for digital image enhancement has been presented in this paper. The principal characteristic of this filter is the use of half Gaussian kernels to detect a gradient modulus. This kind of kernels allows the filter to detect corners and their associated directions with accuracy. Furthermore, the shock-diffusion strategy depends on the value of the gradient modulus and the two directions of the estimated edges. By applying a mirror rotation of these directions, a new diffusion process via PDE is proposed and improves the shock-filter efficiency. Experiments on blurred and noisy images show the efficiency in removing blur and noise while enhancing important features like edges and also corners or small objects. The presented experimental results and images resulting of this PDE tied to the best score of the SSIM illustrates the relevance of the proposed image enhancement method. Future works will include automatic diffusion that would lead to an unsupervised restoration. In other words, it constrains to stop the PDE after a number of iterations allowing the enhancement of an image. This is doable by learning or statistic approaches estimating the level of noise and blur before the first iteration. On the other hand, an unsupervised measure (for example a method estimating if flat regions are really flat) on the restoration level may be useful to stop the diffusion process. The adaptation of the proposed method to color image enhancement remains a challenge without creating color artifacts, several manners must be explored for the diffusion process and overall the deblurring process. Eventually, this paper is not a breakthrough, but it adds some contribution, since it devotes an attention to the diffusion directions.