Regularised Diffusion–Shock Inpainting

We introduce regularised diffusion–shock (RDS) inpainting as a modification of diffusion–shock inpainting from our SSVM 2023 conference paper. RDS inpainting combines two carefully chosen components: homogeneous diffusion and coherence-enhancing shock filtering. It benefits from the complementary synergy of its building blocks: The shock term propagates edge data with perfect sharpness and directional accuracy over large distances due to its high degree of anisotropy. Homogeneous diffusion fills large areas efficiently. The second order equation underlying RDS inpainting inherits a maximum–minimum principle from its components, which is also fulfilled in the discrete case, in contrast to competing anisotropic methods. The regularisation addresses the largest drawback of the original model: It allows a drastic reduction in model parameters without any loss in quality. Furthermore, we extend RDS inpainting to vector-valued data. Our experiments show a performance that is comparable to or better than many inpainting methods based on partial differential equations and related integrodifferential models, including anisotropic processes of second or fourth order.


Introduction
Image inpainting [17,32] is the task of filling in missing regions in an image.There are many approaches for solving this task, but in this work we focus on inpainting based on partial differential equations (PDEs).This class of methods is particularly successful in applications with very sparse data such as image compression [20,28,42].
PDE-based inpainting methods are often inspired by physical processes.For instance homogeneous diffusion [26,27,54] is inspired by heat propagation, and Euler's elastica inpainting [32,33] is connected to the elasticity of solids.
Creating a high quality inpainting result with PDE-based methods has some particular challenges.Many operators struggle to bridge large gaps, introduce dissipativity into high contrast images (such as binary ones), or do not reproduce the direction of structures accurately.It is often assumed that high order PDEs such as Euler's elastica [32,33] or Cahn-Hilliard inpainting [4] are necessary to address these challenges.However, edge-enhancing diffusion (EED) [49] as a second order integrodifferential process has been shown to provide the desired properties in practice as well [42].
One useful property in the context of inpainting is the fulfilment of a maximumminimum principle which guarantees that no over-and undershoot are introduced.Most higher order methods violate this principle.EED satisfies a maximum-minimum principle in the continuous case, but to date there is no discretisation with reasonably small stencils available that inherits this property.
Contributions.In order to address these challenges, we have proposed diffusionshock inpainting in our conference publication [41].It is a PDE-based inpainting operator that fulfils the desired properties in practice, while also providing a maximum-minimum principle in the discrete case.This is achieved by combining two time-proven methods: homogeneous diffusion [26,27,54] and coherence-enhancing shock filtering [52].Originally designed with the goal of deblurring, shock filters create sharp edges at the boundary between influence zones of maxima and minima by using the sign of a second derivative operator [30,35].However, the coherenceenhancing shock filter can also propagate image structures over large distances without directional or dissipative artefacts, which can be seen in Fig. 2(c).In diffusion-shock inpainting, the shock filter propagates edges of image structures without introducing dissipative artefacts.From the newly created structures the homogeneous diffusion term fills in larger homogeneous areas.The synergy of these two methods allows high quality results.Even for high contrast images it reconstructs edges with perfect sharpness and high directional accuracy.Our numerical algorithm satisfies a maximum-minimum principle, and it is optimised for rotation invariance.The experiments in [41] show that diffusion-shock inpainting produces results that rival the quality of state-of-the-art PDE-based inpainting methods such as EED and Euler's elastica.
In addition to our original conference publication [41], we make the following novel contributions in this work: 1. We introduce regularised diffusion-shock (RDS) inpainting as a regularised version of diffusion-shock inpainting.To this end we replace the sgn function that acted as guidance for our original diffusion-shock inpainting model by a sigmoid-like function.This stabilises the process w.r.t. the parameter choice, which allows us to establish a parameter coupling without loss of quality.Thereby we reduce the number of parameters to two, which makes the model more accessible in practice.
curves, and to edge-enhancing diffusion [49], which is the core of the state-of-the-artimage compression codec R-EED [42].Furthermore, we consider the popular higher order inpainting method based on Euler's elastica [32,33].Deep learning techniques have gained popularity for solving inpainting tasks in the past decade [36,59].Especially the recent approaches based on probabilistic diffusion [25,38,45] have sparked a public discussion due to their highly realistic image generation capabilities.While such models can work well in practice, they typically involve a huge number of parameters that make it very difficult to gain a deeper understanding of their inner workings.Furthermore, they usually do not provide any formal guarantees.On the other hand, our RDS inpainting is a PDE-based model that relies on time-proven components that are carefully selected for the task of image inpainting.The corresponding numerics relies on schemes that are well understood, and it satisfies a maximum-minimum principle.Comparing these two opposite ideologies would not do justice to either of them.Therefore, we do not compare our method to purely learning-based approaches.However, neural networks may also incorporate modelbased ideas [23].This can be used for the implementation of numerically challenging models; e.g.[43] uses a neural network for solving Euler's elastica for image inpainting.
In our experiments, we compare our RDS inpainting to this hybrid approach.
Organisation of the Paper.In Section 2, we review the concept of shock filters.Section 3 introduces the RDS inpainting model in the continuous setting.A numerical scheme with high rotation invariance and stability guarantees in the maximum norm is discussed in Section 4. We evaluate our model experimentally in Section 5, before concluding the paper in Section 6.

Review of Shock Filters
Shock filters have been introduced with the goal of image sharpening and deblurring.By propagating the values of extrema to their influence zones, shocks are formed at the boundary of these zones.The various ways of characterising these influence zones create different shock filter models that we briefly review in this section.

PDE-based Morphology
For brightening and darkening of image regions, shock filters rely on the building blocks of mathematical morphology [46]: dilation and erosion.The dilation ⊕ of a grey value image f : Ω ⊂ R 2 → R replaces the image value in a location x by its supremum within a neighbourhood B, the so-called structuring element. 1 The erosion ⊖ uses the infimum instead.The operations are defined as For shock filters, their PDE-based formulations are more popular.Dilation/erosion u with a disk-shaped neighbourhood of radius t correspond to the solution u(x, t) of with the initial image u(x, 0) = f (x) and reflecting boundaries [1,3,7].The + sign corresponds to dilation, and − yields erosion.We denote the spatial nabla operator by ∇ = (∂ x , ∂ y ) ⊤ , and | • | is the Euclidean norm.

Shock Filters
In order to achieve the desired sharpening, shock filters apply dilation and erosion adaptively: In influence zones of maxima they use dilation, and in influences zones of minima they apply erosion.This switch is modelled by considering the sign of a second derivative operator.In general, shock filters have the form The guidance term F (Lu) determines the behaviour of the shock filter.It consists of the second order derivative operator Lu and the guidance function F : R → [−1, 1], which has to retain the sign of its input.
We distinguish the shock filter types by their second order derivative operator Lu.Osher and Rudin [35] considered the Laplacian Lu = ∆u and the second derivative Lu = ∂ ηη u in the normalised gradient direction η ∥ ∇u.They argue that ∂ ηη u gives better results.This is in accordance with findings of Haralick [24], who favours the zero crossings of ∂ ηη u over the ones of ∆u as edge detectors.We confirm this in Fig. 1.Both filters result in a non-flat, segmentation-like steady state and sharpen the image without drastically changing its structure.However, the second derivative in gradient direction yields cleaner edges.
To robustify the process against noise, Alvarez and Mazorra [2] introduced a presmoothing to the derivative operator and used Lu = ∂ ηη u σ , where u σ = K σ * u denotes the convolution of the image with a Gaussian of standard deviation σ.Applying this presmoothing may drastically change the structure of the evolving image.
For his coherence-enhancing shock filter, Weickert [52] uses the second derivative in direction of the dominant eigenvector w (i.e. the eigenvector with the larger corresponding eigenvalue) of the structure tensor J ρ (∇u) = K ρ * (∇u∇u ⊤ ) [18].Hence, the coherence-enhancing shock filter relies on Lu = ∂ ww u σ .We use J ρ (∇u σ ) instead of J ρ (∇u) since it yields better results for our application.Hence, the dominant eigenvector w depends on the noise scale σ and the integration scale ρ.As is common in the structure tensor literature, we do not make this explicit by adding extra indices.As the dominant eigenvector of the structure tensor corresponds to the direction of the largest local contrast, this filter has a coherence-enhancing effect.Similar observations exist in the context of coherence-enhancing diffusion [51].
While the choice of Lu determines the main behaviour of the shock filter, one may also choose from various guidance functions F .In our conference publication [41] we   relied on the sgn function as the most widely used choice.However, different sigmoidlike functions have been used in the literature, including arctan functions [22] or hyperbolic tangent functions [19].For our RDS inpainting, we rely on sigmoid-like functions as a regularised alternative to the sgn function.We will evaluate the benefits of this choice in our experiments.
In Fig. 2, we investigate the potential of shock filters to propagate structures over large distances by the example of a partial line.The Alvarez-Mazorra model shrinks the line to a small disk-like shape.The coherence-enhancing shock filter elongates the line perfectly over a distance of more than 200 pixels in a direction that is not grid aligned.Moreover, it creates a perfectly sharp result without introducing any dissipativity.This quality is exceptional for PDE-based methods.Therefore, we choose the coherence-enhancing shock filter as a key component of our RDS inpainting.

Regularised Diffusion-Shock Inpainting
For image inpainting, we decompose the rectangular image domain Ω into two regions: The known data locations are represented by the inpainting mask K ⊂ Ω, and the unknown values are located in the inpainting domain Ω\K.In the inpainting domain, a PDE-based inpainting method applies a suitable differential operator until the process converges.For RDS inpainting a weighted combination of a regularised coherenceenhancing shock filter and homogeneous diffusion takes that role.
As we show in Fig. 2, the coherence-enhancing shock filter can propagate edgelike structures over arbitrarily large distances with perfect sharpness and directional accuracy.However, the width of the created structures is limited by the presmoothing scale σ.Here, homogeneous diffusion is the ideal partner: It efficiently fills the missing large areas from the sharp edges created by the shock filter.
In order to achieve this behaviour, we apply a weighted combination of the two components such that the shock term dominates near edges, and the diffusion term takes over in more homogeneous regions.We model this by means of a Charbonnier weight function [11] with the Gaussian-smoothed image u ν = K ν * u.It is a decreasing function with range (0, 1], for which we have g(0) = 1 and g(|∇u By presmoothing the image before computing the gradient, we locally average structural information and stabilise the process w.r.t.noise.With that, our regularised diffusion-shock (RDS) inpainting is based on the PDE We use Dirichlet data at the boundaries ∂K of the inpainting mask and reflecting boundary conditions on the image domain boundary ∂Ω.By S ε we denote a sigmoidal function with a regularisation parameter ε > 0. This adds additional regularisation to the model: It softens the transition from dilation to erosion in the shock term.This choice is reminiscent of the regularisation of the Chan-Vese model for segmentation [10], which relies on a rescaled family of arctan functions.In our experiments, we will use As depicted in Fig. 3 the regularisation parameter ε determines the steepness of the arctan function.For ε → 0, we arrive at the diffusion-shock inpainting model from our conference publication [41], which uses a sgn function instead.

Parameter Coupling
The model parameters of RDS inpainting fall into two natural categories: The noise scale σ, the integration scale ρ, and the edge scale ν serve as spatial scale parameters within the image domain, whereas the contrast parameter λ and the regularisation parameter ε are tonal scale parameters acting in the codomain.This classification allows to introduce a parameter coupling that reduces the five parameters to only two.This greatly eases the practical applicability of RDS inpainting.
The noise scale σ determines the width of the structures created by the shock term.In the computation of the structure tensor J ρ (∇u σ ) it removes noise and small-scale details.In order to avoid cancellation effects of gradients with opposite orientation and very wide borders of edge-like structures σ should be chosen relatively small.The integration scale ρ allows averaging of directional information without cancellation effects.It stabilises the directional accuracy of the coherence-enhancing shock filter.A larger ρ usually gives a better directional accuracy.Therefore one should usually choose ρ > σ.The edge scale ν of the weighting function averages structure information locally.Especially in the beginning of the evolution, there may not be sufficient unambiguous structural information available for the shock term to identify meaningful structures.Presmoothing the gradient information with a sufficiently large edge scale allows to assign a suitable weighting to the diffusion term and the shock term.
The contrast parameter λ and the regularisation parameter ε control the tonal behaviour of RDS inpainting in its codomain.As depicted in Fig. 4, the contrast parameter λ determines how fast the Charbonnier weight decreases.A smaller λ leads to a larger zone of gradient values in which the shock term dominates.The regularisation parameter ε softens the transition from dilation to erosion and avoids too rapid edge formation in the beginning.For small values of the second derivative operator in the guidance term, it shrinks the strength of the shock filter.A small ε yields a very harsh transition, and a large ε results in a more gradual evolution towards the discontinuous steady state.
In order simplify the parameter optimisation in practice, we calibrate the five parameters by a single one in each category.For that purpose, we couple the spatial scales to each other.We choose ρ = ν = 1.6 • σ since it works well for all of the experiments that we performed.Moreover, we couple the tonal parameters λ and ε.
With that we addressed the main drawback of our conference publication [41]: the large number of parameters.We reduced the number of parameters that have to be optimised to two.This makes RDS inpainting easier to use in practice.Let us also emphasise that the newly introduced regularisation allows the parameter coupling without a loss in quality in comparison to our original diffusion-shock inpainting from [41].Our experiments demonstrate that RDS inpainting gives better results than the original diffusion-shock inpainting from [41] if parameter coupling is applied to it.

Extension to Vector-Valued Data
Let us now consider a vector-valued image f : Ω → R nc with n c channels.Vectorvalued data are common in image processing as they are typically used for RGB colour images or hyperspectral data.Since our RDS inpainting relies on structural information for guidance, a simple channelwise application is not appropriate: The shock term might create shocks at different locations for each channel, and the weighting of the shock term and the diffusion term could vary across the channels.
By utilising a joint squared gradient magnitude [12] as well as a joint structure tensor [21,50], we can synchronise the operations across all channels.The joint Charbonnier weight is given by and the joint structure tensor is This strategy is also in line with the multi-channel version of the coherence-enhancing shock filter from [52].Overall, for the vector-valued image u : Ω × [0, ∞) → R nc the following evolution describes RDS inpainting in the inpainting domain: for each channel c.As in the scalar-valued case, we use Dirichlet data at the boundaries ∂K of the inpainting mask, and reflecting boundary conditions on the image domain boundary ∂Ω.

Numerical Algorithm
In order to apply our model to a discrete image (f i,j ) with pixels (i, j) and grid size h, we discretise (6) with an explicit scheme.The discrete evolving image u k i,j is an approximation of u(x, t) in the cell-centred location x = (i − 1 2 , j − 1 2 ) ⊤ at the time t = kτ , where k is the iteration number and τ is the time step size.For the time derivative, we apply a forward difference The spatial derivatives are evaluated at the old time level k.

Approximation of Homogeneous Diffusion
For the approximation of the homogeneous diffusion term ∆u we rely on the δ-stencil of Welk and Weickert [56].They propose a convex combination of axial and diagonal central differences in order to achieve a high degree of rotation invariance.The corresponding stencil is given by with a weight δ ∈ [0, 1].As is common in the numerical literature, the stencil notation specifies the discrete convolution weights in the locations An explicit discretisation of the homogeneous diffusion equation ∂ t u = ∆u with this stencil results in the following iterative scheme: with u 0 i,j = f i,j .Thus, u k+1 i,j is a convex combination of the image data at time level This implies stability in terms of the maximum-minimum principle f n,m for all i, j, and for k ≥ 0. (15)

Approximation of Dilation and Erosion
To discretise the morphological terms ±|∇u|, we rely on upwind schemes.This type of discretisation adaptively selects a one-sided difference that reflect the local transport direction.For dilation and erosion, the classical Rouy-Tourin upwind schemes [39] are a popular choice.However, for the discretisation of the morphological terms ±|∇u| in our RDS inpainting, we follow Welk and Weickert [56] again.They combine the classical axial Rouy-Tourin upwind scheme with its diagonal variant with a weight δ.
For the dilation term |∇u|, the resulting scheme is given by with the weight δ ∈ [0, 1] and u 0 i,j = f i,j .The Rouy-Tourin upwind schemes are designed to adapt the one-sided differences to the local transport direction.Dilation transports bright values into dark regions, and erosion propagates dark values into bright regions.Hence, they have opposing transport directions.Therefore, upwind schemes for erosion flip the finite differences that are present in the dilation scheme.Here, we rely on the work of Welk and Weickert [56] as well.They propose to discretise the erosion term −|∇u| as An explicit scheme with forward difference in time and space discretisation ( 16) or (17) results in the following iterative schemes for dilation (18) and erosion (19): with u 0 i,j = f i,j .They satisfy the maximum-minimum principle (15) if In order to show this, one has to consider all possible schemes resulting from the different cases of the max operations.For the sake of brevity, let us now sketch how to show the stability for the dilation process (18) in the following case: Clearly the statement ( 15) is fulfilled for k = 0 as u 0 i,j = f i,j .Thus, it is sufficient to show that min 21) and ( 22), the dilation scheme (18) has the upper bound If (20) holds, this is a convex combination.Therefore, we have Moreover, we have Thus, the discretisation of dilation ( 18) satisfies a maximum-minimum principle for the case ( 21), (22).The other cases work in the same way.The stability of the erosion evolution can be shown analogously.

Discretisation of RDS Inpainting
To discretise the full RDS inpainting equation, we need to discretise the guidance term of the shock filter and the weight g(| ∇ u ν | 2 ) as well.For that we approximate all first order partial derivatives ∂ x u and ∂ y u in the gradient as well as in the structure tensor with Sobel operators [15], since they offer a good rotation invariance: (26) The Gaussian convolutions are computed in the spatial domain with a sampled and renormalised Gaussian, which is truncated at five times its standard deviation.We compute the normalised dominant eigenvector w = (c, s) ⊤ of the structure tensor analytically, since it is a symmetric 2 × 2 matrix.For the computation of ∂ ww v we use where second order partial derivatives are approximated with the following finite differences: We implement reflecting boundary conditions by adding a layer of mirrored dummy pixels around the image borders.For the Gaussian convolution of the first order derivatives within the structure tensor, we enforce this by imposing zero values at the image boundaries.
Putting everything together yields the following explicit scheme for the RDS inpainting evolution (6): with initial condition u 0 i,j = f i,j .It inherits its stability from the schemes for diffusion and morphology: Theorem 1. (Stability of the RDS Inpainting Scheme) Let the time step size τ of the scheme (31) be restricted by with τ D and τ M as in ( 14) and (20).
Then the scheme satisfies the discrete maximum-minimum principle f n,m for all i, j, and for k ≥ 0. ( 33) Proof.If τ ≤ min {τ D , τ M }, it follows from the stability of the diffusion and morphological processes that Analogously, one can show the condition min For good rotation invariance, we follow the suggestion of Welk and Weickert [56] and use δ = √ 2 − 1.Thus, for h = 1 our scheme satisfies a maximum-minimum principle for τ ≤ τ D ≈ 0.31.This shows a clear advantage of RDS inpainting over EED inpainting [42,55], for which there is currently no numerical algorithm that fulfils a maximum-minimum principle on a bounded stencil.
In order to use this numerical scheme for vector-valued data, we discretise ∆u c , ±|∇u c | and ∂ t u c for each channel c ∈ {1...n c } and apply a channel coupling to the weight and structure tensor as indicated by Eq. (10).The stability limit does not change.

Comparison to Related Approaches
Combinations of smoothing and shock filtering, either explicitly or implicitly, are rare in image inpainting, but fairly common for image enhancement.Many methods combine mean curvature motion (MCM) [6] for smoothing with the shock term of Alvarez and Mazorra [2], see e.g.[2,40,58].These methods are unable to perform inpainting, since MCM is not suitable for inpainting in general [9], and the width of structures propagated by shock filters is limited to the presmoothing scale.Therefore, we compare RDS inpainting with other shock-smoothing combinations that rely on homogeneous diffusion instead.This includes the methods of Kornprobst et al. [29], Fu et al. [19] and Perona-Malik diffusion [37].Table 1 shows the corresponding evolution equations.To isolate the effect of the shock term, we also include a variant of RDS inpainting that uses the shock term of Alvarez and Mazorra [2] instead of the proposed coherence-enhancing shock term.
The experiment in Fig. 5 shows the result of our comparison.It is inspired by a popular experiment for Cahn-Hilliard inpainting from Fig. 2 in the paper [4] .The goal is the reconstruction of a cross.Clearly, RDS inpainting gives the best result: It reconstructs a binary, cross-like shape.All other methods are unable to connect the white bars.Moreover, RDS inpainting also gives a sharper result than the original Cahn-Hilliard inpainting from Fig. 2 in [4].The comparison of Fig. 5 (e) and Fig. 5 (f) emphasises that the coherence-enhancing shock term is crucial for the performance of RDS inpainting.Moreover, it should be noted that our RDS inpainting with parameter coupling requires to specify only two parameters, in contrast to the competing explicit combinations: The method by Kornprobst et al. [29] uses four parameters, and the approach of Fu et a l.[19] has five different parameters.Thus, our approach is easier to use in practice.

Shape Completion
Shape completion is a special case of inpainting, in which data is given by a few parts of a shape.The goal is the reconstruction of the original shape.This is an especially difficult problem for many inpainting operators: It requires very high directional accuracy, the ability to bridge large gaps in the data and to create perfectly sharp edges.Let us now evaluate the performance of our RDS inpainting in the task of shape completion.Fig. 6 shows two challenging examples.Here the goal is to reconstruct a half-plane from only one dipole (i.e. a white pixel next to a black one), and a disk from four dipoles.In both cases, RDS inpainting shows a flawless performance and recovers the desired shapes with the desired sharpness.
To evaluate the performance of RDS inpaiting in comparison to various other PDE-based inpainting techniques, we extend an experiment performed by Schmaltz et al. [42] in Fig. 7. Inspired by the Kanisza triangle, the goal is the reconstruction of a white triangle on a black background of the data given in the disks.Table 1 shows the energies / evolution equations associated with each method.Clearly, homogeneous diffusion [8] and biharmonic interpolation [14], create a very blurry result which is typical for these linear methods.Total variation (TV) inpainting [44] fills the whole area in black.The directional artefacts created by the method of Tschumperlé [47] hint at suboptimal numerics in the original paper.Due to its suitability for connecting level lines, the Bornemann-März model [5] creates a satisfactory result but suffers from directional inaccuracies.Edge-enhancing diffusion (EED) [42,55] reconstructs a perfect triangle.Schmaltz et al. [42] attribute this high performance to the anisotropy and the semilocality of the approach.By semilocality they refer to the fact, that EED uses neighbourhood information rather than acting purely local.RDS inpainting shares these properties.The coherence-enhancing shock term introduces a strong anisotropy, and the presmoothing procedures create semilocality.It also creates a high quality result without any directional artefacts, and the created edges are even sharper than those created by EED.Additionally, in contrast to EED our numerical algorithm for RDS inpainting also provides a maximum-minimum principle in the discrete case.
In Fig. 8, we compare the performance of RDS inpainting to EED [49] and Euler's elastica [32,33], two methods that produce state-of-the-art results in the context of shape completion.Table 1 shows the evolution equation of EED and the energy functional that corresponds to Euler's elastica.The results of Euler's elastica are published in [43] and were given to us by the authors.The cat data and the EED inpainting of the cat are the original images from [53] that were provided to us by the author.In both examples RDS inpainting shows similar results as EED and Euler's elastica.Overall, RDS inpainting creates the sharpest results.

Evaluation of the Guidance Function
In the model of RDS inpainting, we use an arctan function as the guidance function, whereas the original diffusion-shock inpainting from [41] relies on the sgn function.While the original model has already provided high quality results, it requires the optimisation of four parameters, which makes the method difficult to use in practice.In order to address this drawback, we have proposed a parameter coupling in a previous section.Applying these ideas to diffusion-shock inpainting based on a sgn function decreases the inpainting quality.This is not the case for RDS inpainting.Fig. 9 demonstrates this by the triangle reconstruction example.Clearly, the arctan-guided result is superior: It creates sharper edges and reproduces a better directional accuracy.
The cat reconstruction experiment in Fig. 10 makes this even more apparent.Here, we compare the result from Fig. 5 of our conference publication [41] which used a sgn-guided diffusion-shock inpainting without parameter coupling (b), sgnguided diffusion-shock inpainting with parameter coupling (c) and RDS inpainting with parameter coupling (d).Clearly, RDS inpainting with parameter coupling creates a result that is very similar to the conference publication.However, the sgn-guided diffusion-shock inpainting is not able reconstruct the cat in a satisfactory way.This highlights the necessity of the regularisation in RDS inpainting for a parameter coupling that does not lead to a loss of inpainting quality.

Natural Images
So far, we considered only binary images since they are especially challenging for PDEbased inpainting techniques.In Fig. 11 and Fig. 12, we show that RDS inpainting is also a suitable method for the reconstruction of natural images from sparse data.Fig. 11 shows this for greyscale images of size 256 × 256.There, the runtime was 2.3 seconds for the peppers image, 2.5 seconds for the walter image and 2 seconds for the house image on a PC with an Intel © Core™i9-11900K CPU @ 3.50 GHz.Fig. 12 depicts several RDS inpainting results created from sparse colour images.The original images are cropped versions of images from the Kodak dataset [16].The sparse data are created by randomly selecting 20% of the pixels.The results show the effect of using a joint structure tensor and a joint weighting function for vector-valued images: Edges are formed in a synchronised way, and no unexpected colours or colour artefacts are introduced.

Conclusions and Future Work
We have proposed regularised diffusion-shock (RDS) inpainting as an extension of our diffusion-shock inpainting from [41].Diffusion-shock inpainting is the first method to utilise the perfect sharpness and directional accuracy of a coherence-enhancing shock filter [52] in the field of inpainting.Together with homogeneous diffusion [26,27,54], it creates results that rival the quality of popular PDE-based inpainting operators such  as edge-enhancing diffusion [49] and Euler's elastica [32,33].However, in contrast to these methods, its numerical algorithm also satisfies a maximum-minimum principle in the discrete case.
RDS inpainting introduces a regularisation to the original model.It stabilises the model w.r.t. the choice of parameters, and thereby allows the reduction of the number of parameters to two.This solves the largest disadvantage of the original diffusionshock inpainting model from [41].RDS inpainting is a second order integrodifferential process consisting of two simple components: homogeneous diffusion and coherence-enhancing shock filtering.We showed that it can offer equal or higher quality than higher order methods.However, higher order methods are algorithmically more challenging and often do not provide stability guarantees.On the other hand, our RDS inpainting allows a simple discretisation with an explicit scheme that provides a maximum-minimum principle.It constitutes a high quality second order integrodifferential process that questions the necessity of higher order methods in practice.This highlights the potential behind this class of methods, and we are aiming at gaining a deeper understanding of such integrodifferential processes in our ongoing work.
Most PDEs for inpainting are elliptic or parabolic.However, our results emphasise that hyperbolic processes deserve far more attention.They are a natural concept for modelling discontinuities, and shock filters are a prototype for this.For our application the coherence-enhancing shock filter in combination with homogeneous diffusion is the ideal choice.Interestingly, both components have been around for at least 20 years.This indicates that there still lies a huge potential in PDE-based inpainting, especially in hyperbolic concepts.Thus, we aim at exploring them further in our future work.

Fig. 1
Fig. 1 Visual comparison of the steady states of shock filters with different guidance terms with F (u) = sgn(u).

Fig. 2
Fig. 2 Alteration of an edge-like structure by different shock filters with presmoothing.The steady states of the different shock filters with F (u) = sgn(u), σ = 2 and ρ = 5 are shown.

Fig. 4
Fig. 4 Effect of the contrast parameter λ on the Charbonnier diffusivity.

Fig. 7
Fig.7Comparison of inpainting methods.Top: Input image with known data in the disks and noise in the unknown region, homogeneous diffusion, biharmonic interpolation, and TV inpainting.Bottom: Tschumperlé's approach, Bornemann-März (BM) method, EED inpainting, RDS inpainting with σ = 3.5 and λ = 3.All images apart from (h) were provided to us by the authors of[42].