1. Introduction and Background
In 2002, Fattal et al. [
1] introduced the method of gradient-domain high-dynamic-range compression. The technique consisted of first computing the gradient field
of a high-dynamic-range image
, where
is the image domain and
is the colour space. The gradient was then rescaled nonlinearly as
. The resulting tensor field
, which is no longer necessarily a gradient field, was then reintegrated by solving the Poisson equation
to obtain the compressed image. This is often solved by a gradient descent,
The Poisson equations can be obtained through a variational approach by minimising the functional
where
is the image domain and the index
F indicates the Frobenius norm taken over both image and colour coordinates. This is done by solving the corresponding Euler–Lagrange equations,
leading to Equation (
1).
Perez et al. [
2] soon generalised this into the technique called Poisson Image Editing, and showed that it allowed for a broad range of image processing applications such as image inpainting, seamless cloning, texture transfer, feature exchange, insertion of transparent objects through gradient mixing, texture flattening, local illumination correction, and seamless tiling. All this is obtained by various processing of the gradient or gradients of the original images to obtain the tensor field
used in Equation (
1).
One significant challenge of Poisson Image Editing is that it tends to produce visual haloing or blurring artefacts in the reconstructed images. The case of
in Equation (
1) is often used for image denoising. For greyscale images, in order to stop the diffusion at edges, and thus reduce the blurring, Perona and Malik [
3] introduced an image-dependent, local, nonlinear diffusion method described by the equation
where
describing the image ‘structure’ has been introduced. (Despite the fact that the method is isotropic, but nonlinear and local, the authors termed it ‘anisotropic diffusion’ in the original publication [
3]. This has caused considerable confusion in the terminology in the following literature.) They proposed two different diffusion coefficients with different properties,
Instead of designing partial differential equations (PDEs) directly, Rudin et al. [
4] used a variational approach like Equation (
3) and introduced the concept of total variation. They showed that the minimisation of the functional
leads to the PDE
Comparing with the Perona–Malik diffusion, Equation (
5), we see that it can be written in the same form choosing
For total variation and Perona–Malik diffusion, the extension to colour images is not that straight forward. Blomgren and Chan [
5] introduced the concept of colour total variation by using a functional as an
norm of the functionals in Equation (
8) for each of the colour channels resulting in
where
is the total variation for each colour channel according to Equation (
8).
Later approaches have been based on the structure tensor by Di Zenzo [
6] and Bigun and Granlund [
7], with components
where the dot product is taken over the colour coordinates. Sapiro and Ringach [
8] proposed to use the eigenvalues
and the corresponding eigenvectors
of the structure tensor as a basis for constructing the diffusion equations. In terms of these eigenvalues, an alternative to the colour total variation by Blomgren and Chan [
5] can be obtained by the functional
For greyscale images, where
and
, this reduces to total variation. For colour images, the corresponding Euler–Lagrange equations become
which again is on the form of Equation (
5) with
. Notice the coupling between the colour channels introduced by the sum in the denominator of Equation (
15).
Tschumperlé and Deriche [
9] extended this approach to a anisotropic diffusion by introducing the general Lagrangian density
in the functional
The corresponding Euler–Lagrange equations are
where
is the diffusion tensor
where
are the eigenvectors of the structure sensor
. It should be noted that this actually encompasses all previously presented diffusion methods as follows:
gives the solution of Sapiro and Ringach [
8] for colour images and total variation of Rudin et al. [
4] for greyscale images,
give the two equations of Perona and Malik [
3], and
gives the classical linear diffusion, Equation (
2).
Choosing
in general leads to isotropic equations, since then
and the diffusion tensor in Equation (
18) reduces to the scalar diffusion coefficient
. With
the diffusion in the mutually orthogonal directions of maximal and minimal change can be controlled independently, like used by, e.g., Farup [
10].
For other application of Poission image editing, i.e., applications of Equation (
2) where
, extensions to anisotropic and edge-preserving methods have been obtained by ad hoc modifications of Equation (
2). This has been done for e.g., colour gamut mapping [
11], colour image demosaicing [
12], colour-to-greyscale conversion [
13], and colour image Daltonisation [
10]. Common to these is that they solve an equation on the form
where
is a diffusion tensor constructed from the structure tensor like, e.g., Equation (
18).
However, a unifying variational formulation of anisotropic gradient-domain image processing has not yet been given. In this paper, we provide this by introducing the difference structure tensor based on the difference of the original image gradient
and the tensor field
and follow the process of Tschumperlé and Deriche [
9]. The resulting PDE is similar, but not identical, to the ones obtained by the ad hoc modification of Poisson Image editing, Equation (
25). For the applications to linear and nonlinear local contrast enhancement and colour image Daltonisation, we show that the two approaches gives very similar results.
2. Variational Anisotropic Gradient-Domain Formulation
The variational formulation of anisotropic diffusion by Tschumperlé and Deriche [
9] was based on the structure tensor
, Equation (
18). In analogy, we introduce the difference structure tensor,
with eigenvalues
and corresponding eigenvectors
.
In analogy with Tschumperlé and Deriche [
9], we define the functional in terms of the eigenvalues of this difference structure tensor,
The corresponding Euler–Lagrange equations are
It is clear that
. To derive the explicit form of the Euler–Lagrange equations, we will need to look at the individual components. Using Greek indices for the colour coordinates, Latin indices for the spatial coordinates, letting a comma denote partial differentiation with respect to the following coordinates, and using Einstein’s convention of summing over repeated indices, the expression within the parenthesis in the first term can be written
where the index
p is used for summing over the two eigenvalues of the difference structure tensor. The first factor,
, can be computed directly since the Lagrangian
is defined explicitly in terms of the eigenvalues of the difference structure tensor, and will thus depend on the design of the Lagrangian density.
The second factor can be computed implicitly following the method of Tschumperlé and Deriche [
9] as follows:
Multiplying with
and
, summing over the
k and
l indexes, using that
, and
, the latter due to the orthonormality of the
s gives
(no sum).
The last term,
deviates from the derivation of Tschumperlé and Deriche due to the definition of the difference structure tensor, Equation (
26),
Inserted into Equation (
30) and exploiting the symmetry of Equation (
32) gives
where the diffusion tensor
has been defined.
Inserting this into Equation (
29) and solving by gradient descent gives the variational anisotropic gradient-domain image processing PDE (switching back to the regular vector notation):
The form of this equation is similar to the one based on the ad hoc approach, Equation (
25). The only difference is that, in this case, the diffusion tensor is computed from the difference structure tensor, and not the common structure tensor.