Anisotropic Total Variation Filtering
Total Page:16
File Type:pdf, Size:1020Kb
Anisotropic Total Variation Filtering Markus Grasmair Frank Lenzen Computational Science Center Heidelberg Collaboratory University of Vienna for Image Processing Vienna, Austria University of Heidelberg Heidelberg, Germany [email protected] [email protected] April 29, 2010 Abstract Total variation regularization and anisotropic filtering have been es- tablished as standard methods for image denoising because of their ability to detect and keep prominent edges in the data. Both methods, however, introduce artifacts: In the case of anisotropic filtering, the preservation of edges comes at the cost of the creation of additional structures out of noise; total variation regularization, on the other hand, suffers from the stair-casing effect, which leads to gradual contrast changes in homo- geneous objects, especially near curved edges and corners. In order to circumvent these drawbacks, we propose to combine the two regulariza- tion techniques. To that end we replace the isotropic TV semi-norm by an anisotropic term that mirrors the directional structure of either the noisy original data or the smoothed image. We provide a detailed existence the- ory for our regularization method by using the concept of relaxation. The numerical examples concluding the paper show that the proposed intro- duction of an anisotropy to TV regularization indeed leads to improved denoising: the stair-casing effect is reduced while at the same time the creation of artifacts is suppressed. MSC: 68U10, 49J45. 1 Introduction Because of unavoidable inaccuracies inherent in every data acquisition process, it is not possible to recover a precise images from incoming signals. Instead, the recorded data are defective in various manners. Typical problems that may occur are blurring, optical distortions read-out errors, defects of the electronic systems, etc. 1 In the present paper, we concentrate on the treatment of data distorted by random noise. A first ansatz is to apply a low-pass filter, for instance convolution with a Gaussian kernel removing the high frequencies of both the noise and the image content. This is equivalent to solving the heat equation 0 ∂tu − ∆u = 0 , u(0) = u (1) up to some specified time t determining the amount of smoothing, where u0 denotes the given noisy data. The diffused function u(t) then serves as denoised image. Linear diffusion indeed efficiently removes noise, but at the same time it destroys many important features. Edges, that is, discontinuities in the inten- sities, immediately get smeared out and the whole image becomes blurry and diffuse. For these reasons, this method is not suited for most applications of image processing. In order to enhance the quality of the denoised image, Perona & Malik intro- duced a modification of the diffusion equation (1) by a nonlinear diffusivity [17]. Instead of (1), they proposed to solve the equation ∇u ∂ u − div = 0 , u(0) = u0 (2) t 1 + c|∇u|2 with c > 0. The idea behind this modification is to stop the diffusion at edges, which are characterized by steep gradients, while treating regions with nearly constant intensity as in the uniform model. As further improvement and stabi- lization of the solution, Catt´eet al. [7] suggested to scale the diffusivity using the gradient of the uniformly smoothed image. Then the diffusion equation reads as ∇u 0 ∂tu − div 2 = 0 , u(0) = u , (3) 1 + c|∇uσ| where uσ = Kσ ∗ u denotes the convolution of u with a Gaussian kernel of variance σ2. A different approach for obtaining well-posedness of a Perona– Malik like equation has recently been suggested in [16]. There, the authors slightly decrease the order of differentiation in the denominator of the diffusivity and arrive at the equation ∇u ∂ u − div = 0 . t 1 + c|∇1−εu|2 If ε > 0 is small enough, the solutions of this equation behave similarly as the solutions of (3). The above methods can be further refined by noting that only diffusion across edges should be prohibited, while diffusion along edges in fact encouraged. To that end it is necessary to consider not only the size of the gradient but also its local direction, which can be computed from the smoothed tensor Jρ(u) := Kρ ∗ (∇uσ ⊗ ∇uσ) for some ρ > 0. 2 The eigenvector v1 corresponding to the largest eigenvalue of Jρ(u)(x) points in the prevailing direction of ∇uσ near x, while the local coherence, that is, the squared difference of the eigenvalues, indicates how pronounced this direction is. This directional knowledge can be incorporated into the diffusion equation by replacing the diffusivity, which for the modified Perona–Malik model (3) has the form 1 , by a matrix or tensor A(u) that decreases the diffusion 1+|∇uσ | only in direction of v1. One possibility for defining the tensor A(u) is shown in Section 2, further details can be found in [21]. With this modification, we obtain the anisotropic diffusion equation 0 ∂tu − div A(u)∇u = 0 , u(0) = u . (4) In [21], it has been shown that the diffusion equation (4) has a unique solution u, which satisfies u(t) ∈ C∞(Ω) for all t > 0. In general, diffusion filtering is closely connected with variational meth- ods [20]. If one applies an implicit Euler scheme for solving the time discretized diffusion equation, one obtains that each step requires the minimization of a variational functional. In the case of anisotropic diffusion, this functional reads as 1 F(u,u0) := (u(x) − u0(x))2 + α∇u(x)T A(u)∇u(x) dx , (5) 2 ZΩ where α > 0 is the step size. 0 0 k k−1 Setting uα := u and defining the functions uα := arg minu F(u,uα ) for k ∈ N, one can show by using standard results from semi-group theory that, for k α sufficiently small, uα is an approximation of the solution of the corresponding diffusion equation at time kα (see [6, 22]). Parallel to the refinement of diffusion methods, a different variational ap- proach was developed. One reason is that, although the goal of anisotropic diffusion was edge enhancement, all models introduced above have the draw- back that the solutions are in fact smooth [7, 21]. Thus it is never possible to recover sharp edges, even if they can be seen clearly in the original noisy data. Also, in regions where no edges are present, the anisotropic model inherits from the isotropic diffusion the problem that it creates texture like structures from the noise, because quadratic regularization term hardly penalizes sufficiently slow oscillations. As a remedy, it was proposed to consider variational regularization meth- ods in the space BV(Ω) of functions of bounded variation, which consists of all integrable functions u : Ω → R whose distributional derivative can be repre- sented by a finite Radon measure Du (see [2, 12]). The most important method is the minimization of the Rudin–Osher–Fatemi or total variation functional (see [1, 18]), which is defined as 1 2 F(u,u0) := u(x) − u0(x) dx + α|Du|(Ω) . (6) 2 ZΩ Note that for a Sobolev function u we have the identity |Du|(Ω) = Ω|∇u(x)| dx. R 3 The linear growth of the regularization term near infinity has the conse- quence that only the total height of a slope is penalized, but not its steepness. This permits the presence of edges in the minimizer, which can be seen as in- finitely steep gradients concentrated on a narrow line. The singularity at zero, on the other hand, encourages zero gradients, as the cost for small oscillations is high compared to a possible gain through the fidelity term ku − u0k2. Thus, the minimizer of the total variation functional typically consists of regions of almost constant intensity, well separated by distinct edges. Still, total variation regularization has its problems: First, it tends to insert edges where they should not be. Smooth changes of the intensities are broken up and a gradual transition is created instead. In the literature, this issue is called stair-casing effect. Second, it leads to a contrast loss near edges that mainly depends on their curvature. Thus, especially corners in objects, but also regions with strongly varying curvature are resolved badly. In order to combine the benefits of anisotropic filtering and total variation regularization, we propose to apply anisotropic total variation regularization based on the functional 2 1 F(u,u0) = u(x) − u0(x) + α ∇uT (x)A(u)(x)∇u(x) 2 dx . ZΩ Similar functionals have already been proposed in the literature for the prob- lem of inpainting (see e.g. [4, 8]). There, the ℓ1-norm of the rotated gradient R(x) ∇u(x) is used as regularization term. Here, we use directional information in order to introduce different weights on the components of ∇u(x) in a local coordinate system in x. The precise definition of the anisotropy matrix A(u) is given in Sec. 2. The linear growth of the regularization term implies that BV(Ω) is the natural space of definition for the functional F. In particular, it is necessary to define how F acts on edges, that is, discontinuities in u. Because the regularization term depends in a non-trivial manner on u, standard results from the calculus of variations (see e.g. [5, 11, 13]) do not apply. Still, it is possible to exploit the structure of A(u), which allows to define the required extension of F to BV(Ω). A detailed derivation of the extension is provided in Sec. 3 along with the proof of the existence of minimizers. We describe the numerical implementation of the regularization method in Sec. 4. The discretization is carried out by a finite element method; for the minimization of the discretized functional we use a steepest descent method combined with a fixed point iteration.