Abstract
In this paper, we present a numerical linear algebra analytical study of some schemes for the Bertozzi–Esedoglu–Gillette–Cahn–Hilliard equation. Both 1D and 2D finite difference discretizations in space are proposed with semi-implicit and implicit discretizations on time. We prove that our proposed numerical solutions converge to continuous solutions.
Keywords:
Cahn–Hilliard equation; image inpainting; finite difference method; numerical linear algebra; stability; steady state MSC:
65M06; 94A08; 65N06; 65N12
1. Introduction
Image inpainting involves the completion of missing portions within an image or video by utilizing information from the surrounding areas. It essentially functions as a form of interpolation and finds applications in diverse domains, such as the restoration of aging paintings by museum artists [1], elimination of scratches from vintage photographs [2], manipulation of scenes in photographs [3], and the restoration of motion pictures [4].
The seminal work by Bertalmio et al. in [5] holds significant importance, presenting a novel approach to image inpainting through the incorporation of Partial Differential Equation (PDE) models. In this context, the authors introduced boundary conditions for PDE image inpainting models. These conditions involve the constant grayscale image intensity and the direction of isophote vectors at the boundary of the inpainting region. The isophote vector represents the orthogonal gradient vector.
In 1958, John Cahn and John Hilliard proposed the chemical energy for the Cahn–Hilliard equation to characterize phase separation phenomena, specifically phase coarsening in binary alloys. This phenomenon becomes apparent when a binary alloy is sufficiently cooled, leading to the emergence of nucleides in the material (partial or total nucleation). This process, known as spinodal decomposition, results in rapid material inhomogeneity, forming a fine-grained structure with alternating appearances of the two components. Subsequently, during a slower time scale phase called coarsening, these microstructures enlarge. The Cahn–Hilliard equation finds applications in various fields, including image processing, biology, and population dynamics. In 2007, Bertozzi et al. proposed the modified Cahn–Hilliard equation for binary image inpainting in [6], where the fidelity term is added to the Cahn–Hilliard equation. The authors in [7] demonstrated the existence of a unique local solution over time, while those in [8,9] established both the global solution in time and the existence of a finite-dimensional global attractor. The model has also been studied with singular (logarithmic) nonlinear terms, resulting in faster and more efficient image inpainting. The Cahn–Hilliard equation is not limited to binary image inpainting; various adaptations are employed for color image inpainting (see [8]) and grayscale image inpainting (see [9]). The modified Cahn–Hilliard for binary image inpainting is given by
which can be written in the following system:
where represents a bounded domain in for , where stands for a given (damaged) image, and denotes the inpainting region (total region). The term constitutes the fidelity term, representing the indicator function. The choice of this term, as opposed to a condition such as outside the inpainting domain, is motivated by several factors, especially in light of the model’s analysis. Notably, there is no need for regularity assumptions on D, and h outside D does not need to be perfectly known (it could be, for example, noisy).
Additionally, nonlinear term f is defined as , for all . It is essential to note that this nonlinear term f corresponds to the derivative of potential . The underlying idea in this model is to solve (1) until a steady state is reached, thereby obtaining inpainted version of the original damaged image . The equation has been examined with Neumann boundary conditions, as discussed in [8,9].
Our objective in this paper is to propose and analytically study various numerical linear algebra schemes for solving Problem (1) with Dirichlet boundary conditions. In the first part, we introduce a 1D finite difference discretization in space along with a semi-implicit discretization in time. We demonstrate the convergence of our proposed numerical solution to the continuous solution. Additionally, we present a 1D finite difference discretization in space with an implicit discretization in time and provide proof of convergence to the continuous solution once more. In the second part, we introduce 2D schemes based on finite difference discretization in space, utilizing both semi-implicit and implicit discretizations in time. Finally, we conduct a thorough analysis of the convergence of these schemes to the continuous problem in both cases.
2. 1D Discretization
2.1. 1D—Semi-Implicit Fully Discretized Scheme
Consider one-dimensional system
where , , for , , where and , and denotes the indicator function such that
Using the centered difference and Euler’s backward difference methods, let where be the uniform step on the x-axis such that , and let be the time step such that for . Then, the semi-implicit 1D system scheme is as follows:
which is similar to
The matrix form of the scheme is as follows:
where A and B are symmetric matrices such that , , , , and with boundary conditions , .
Definition 1.
Consider vector in . Say that v is positive and write if and only if , for all .
Theorem 1.
B is positive definite.
Proof.
Let , then
Moreover, if , then , which implies that and for all , and hence . Since , infer that so that . Therefore, B is a symmetric positive definite matrix. □
Corollary 1.
B and are symmetric positive definite matrices.
Corollary 2.
A and are symmetric negative definite matrices.
2.1.1. Existence of the Steady State
Consider steady state system
So,
But
which implies that
and hence
which is similar to
Consequently, since B is invertible and positive definite, and , the discrete form, then the minimum eigenvalue of is equal to , and equals to the inverse of the least eigenvalue of operator , such that
Solving (6) for , obtain the following two equivalent forms:
or
Now, define operator H as
so that
In the following, consider sequence
Then,
Suppose that , then
Hence, is a positive sequence for a large enough .
Lemma 1.
Suppose that λ is large enough; then, is a decreasing sequence such that .
Proof.
Suppose that . Then,
Hence, is a decreasing sequence for all
However, , then . It then follows that
□
Corollary 3.
Under assumption (H) that for some , system
admits solution such that .
Proof.
It is clear that
But , for all , which implies that . Therefore,
In addition, implies that , where . Thus,
In addition, there is
It then follows from assumption (H) that
□
2.1.2. Convergence of the Solution
Suppose that , and let and be the steady states of system
Then,
Subtracting (7) from (8), obtain the following system:
This implies that
Hence,
Let and . Then,
which is equivalent to
Now, since is symmetric and positive definite, then is also symmetric positive definite and invertible such that .
Hence,
Moreover, since is an increasing function and , then
Therefore,
Moreover, since is positive definite and , then . This implies that is well defined and for all .
Theorem 2.
converges to 0 if
Proof.
Consider sequence , matrix , Euclidean inner product , and associate norm . Then,
Hence,
This implies that
Therefore, converges to 0 if
which is equivalent to
Therefore,
□
2.2. 1D—Implicit Fully Discretized Scheme
The fully discretized implicit 1D system scheme, (3), can be written as follows:
which is similar to
The matrix form of the scheme is as follows:
where B is an invertible and positive definite matrix, and is a negative definite matrix. Moreover, and . The system is equivalent to
and hence
where
with , , , and .
Existence of Roots of Q and H Such That and
Let and be the roots of Q and H such that
which is equivalent to
and implies that
where B and are positive definite matrices. Hence,
Theorem 3.
Assume that for some , then Equation (9) admits solution such that .
Proof.
Conducted in Corollary 3. □
Theorem 4.
Assume that
for some , then admits solution .
Proof.
It is clear that
But
This implies that
and hence
But
which implies that
Therefore,
Now, in order to find and such that
which is equivalent to
let
Let , and for all . Then, using Newton’s method, it is obtained that the sequence for all converges to such that is the root of F, so that . □
Moreover, by Newton’s Method, there is
Hence, in order to find and , the Jacobian block matrix of has to be computed at each iteration of . This implies that
The Jacobian of F is
and
Now, let be the roots of F such that . This implies that
and
where I is the identity matrix with , and
with
since .
Theorem 5.
is invertible if and only if .
Proof.
Moreover,
□
Corollary 4.
If for all , then is invertible and , where .
Proof.
Since , then ; in particular, is continuous at , and by the definition of continuity of at , there exist , and such that ; and for any , there is
and
hence, is invertible (Von-Neumann Lemma). Then, for every , there is
□
Lemma 2.
If and , then
where
Proof.
Let
so that
By the fundamental theorem of calculus, there is . Hence,
But , so if norms of the previous equality are taken, there appears
since ; then, by the mean value theorem, there is
Hence,
If is taken, then
By Newton’s Raphson method, there is
which implies that
and
Hence,
which is equivalent to
□
Theorem 6.
Let . Then, is invertible and converges to .
Proof.
If , then is invertible and . Thus, is well defined. By Newton’s method, obtain
which implies that
Now, suppose that the previous equality holds for every . So, is invertible and , where . This implies that is well defined and
But
Therefore, , and is invertible such that
Moreover, and is invertible for every . So, sequence is well defined and
This implies that
But , which implies that . Therefore, □
3. Two-Dimensional Discretization
3.1. 2D—Semi-Implicit Fully Discretized Scheme
Consider two-dimensional system
where , , for , , and . Let and let be the uniform step on the x and y axes, respectively, such that , , , and . In addition, let be the time step such that for . Then, the fully discretized semi-implicit 2D system scheme, (10), can be written in the following form:
with boundary conditions
where , , , and .
Scheme (11) can also be written in the following form:
Since , the system is equivalent to
The matrix form of Scheme (12) is as follows:
with
where A and E are symmetric tridiagonal block matrices such that
where , and .
where , and .
and
Lemma 3.
Block matrix A is positive definite.
Proof.
Let ; then, making some calculations, obtain
Now, if , then
which implies that , , and . So, , and hence .
Therefore, A is a symmetric positive definite block matrix. □
Corollary 5.
Using the fact that A is a symmetric positive definite block matrix, A is invertible and .
Corollary 6.
Since A is a symmetric positive definite block matrix, and , where , E is invertible such that and .
3.1.1. Existence of the Steady State
Consider the system which is the centered divided difference scheme of the steady state,
which is equivalent to
But
Hence,
Since A is invertible and positive definite, is also positive definite and is the discrete form, where the minimum eigenvalue of is equal to . Hence,
Solving (13) for , obtain two equivalent forms as follows:
or
Now, define operator H as
so that
and consider sequence
Thus,
Moreover, if , then
Hence, is a positive sequence for all if is large enough.
Lemma 4.
is a decreasing sequence such that .
Proof.
Suppose that . Then,
Hence, is a decreasing sequence for all Note that ; infer that
□
Now, let , which implies that , where , so that
In addition, there is
which yields
and
where the assumption (H’) (given in the next corollary) is used as well as the fact that for some , and .
Corollary 7.
Under assumption (H’) that is for some , find that
admits solution such that .
3.1.2. Convergence of the Solution
Suppose that , and let and be steady states of the system
Then,
Subtracting (15) from (14), obtain the following system:
which is equivalent to the following difference equation:
Hence,
which yields
Let and , then
which is equivalent to
Now, since is a symmetric and positive definite block matrix, then is also symmetric positive definite, and it is invertible such that . Therefore,
Moreover, since is a decreasing function, and , then
This implies that
Therefore, is well defined and for all .
Theorem 7.
converges to 0 if
Proof.
Consider sequence , matrix , Euclidean inner product , and associate norm . Then, for , and
Hence,
This implies that
Therefore, converges to 0 if
which is equivalent to
and hence
□
3.2. 2D Implicit Fully Discretized Scheme
The semi-implicit 2D time discretization of System (1) is given as follows:
with , and boundary conditions
where , . Now, if , then the scheme can be written in the following form:
Since , the system is equivalent to
Now, if and , then the matrix form of the scheme is as follows:
where A is symmetric positive definite block invertible matrix such that , and is also symmetric and negative definite invertible block matrix such that . Define and such that
which have the following matrix form:
where
with
Existence of Roots of Q and H Such That and
Let and be the roots of Q and H such that
and
Hence,
If is substituted, the following difference equation can be obtained:
where A and are positive definite matrices. Hence,
Theorem 8.
Assume that for some ; then, (16) admits solution such that .
Proof.
Performed in Corollary 7. □
Theorem 9.
Assume that for some ; then, admits solution such that .
Proof.
Since ,
But
This implies that
and hence
But
which implies that
Therefore,
□
Now, in order to find and such that and , let
which is equivalent to
Let , and for all . Then, using Taylor series expansion, obtain
where is a function in and .
But and are roots of so that . So, using Newton’s Method, obtain
So, in order to find and , compute the Jacobian block matrix of at each iteration of . Since
the Jacobian of F is
This implies that for all , there is
where
such that ,
Moreover, for and , and , and , and , obtain
Theorem 10.
is invertible if and only if .
Proof.
□
Corollary 8.
If for all , then is invertible and
Proof.
Since , then ; in particular, is continuous at , and by the definition of continuity of at , there exist , and such that , and for any , there is
and
and hence, is invertible (Von-Neumann Lemma). Then, for every , there is
□
Lemma 5.
If and , then
where
Proof.
Let
so that
By the fundamental theorem of calculus, there is . Hence,
But , so if norms of the previous equality are taken, the following can be obtained:
since , by the mean value theorem, there is
Hence,
If is taken, then
By Newton’s Raphson method, there is
which implies that
and
Hence,
which is equivalent to
□
Theorem 11.
Let ; then, is invertible and converges to .
Proof.
Suppose that ; then, is invertible and . Thus, is well defined and, by Newton’s method, there is which implies that
Suppose that the previous equality holds for , so that is invertible and , where . Then, is well defined and hence
But
and , which implies that
Therefore, , and is invertible such that
Moreover, , and is invertible for every . So, sequence is well defined and
which implies that
But , which implies that . Therefore, , and hence converges to . □
Author Contributions
Conceptualization, Y.A. (Yahia Awad) and H.F.; methodology, Y.A. (Yahia Awad) and H.F.; formal analysis, Y.A. (Yahia Awad), H.F. and Y.A. (Yousuf Alkhezi); investigation, Y.A. (Yahia Awad) and H.F.; data curation, Y.A. (Yahia Awad) and H.F.; writing—original draft preparation, Y.A. (Yahia Awad), H.F. and Y.A. (Yousuf Alkhezi); writing—review and editing, Y.A. (Yahia Awad), H.F. and Y.A. (Yousuf Alkhezi); visualization, Y.A. (Yahia Awad) and H.F.; funding acquisition, Y.A. (Yousuf Alkhezi). All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Data Availability Statement
No new data were created or analyzed in this study. Data sharing is not applicable to this article.
Acknowledgments
The authors express deep gratitude to the editor and referees for their invaluable input and contributions that have significantly enhanced the manuscript’s quality and impact.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Emile-Male, G. The Restorer’s Handbook of Easel Painting; Van Nostrand Reinhold: New York, NY, USA, 1976. [Google Scholar]
- Braverman, C. Photoshop Retouching Handbook; IDG Books Worldwide: Amsterdam, The Netherlands, 1998. [Google Scholar]
- King, D. The Commissar Vanishes; Henry Holt: New York, NY, USA, 1997. [Google Scholar]
- Kokaram, A.C. Motion Picture Restoration: Digital Algorithms for Artefact Suppression in Degraded Motion Picture Film and Video; Springer: New York, NY, USA, 1998. [Google Scholar]
- Bertalmio, M.; Sapiro, G.; Casselles, V.; Ballester, C. Image inpainting. In Proceedings of the 27th Internationl Conference on Computer Graphics and Interactive Techniques Conference SIGGRAPH 2000, New Orleans, LA, USA, 23–28 July 2000; Akeley, K., Ed.; ACM Press/Addison-Wesley: New York, NY, USA, 2000; pp. 417–424. [Google Scholar]
- Bertozzi, A.; Esedoglu, S.; Gillette, A. Inpainting of binary images using the Cahn–Hilliard equation. IEEE Trans. Imag. Proc. 2007, 16, 285–291. [Google Scholar] [CrossRef] [PubMed]
- Bertozzi, A.; Esedoglu, S.; Gillette, A. Analysis of a two-scale Cahn–Hilliard model for binary image inpainting. Multiscale Model. Simul. 2007, 6, 913–936. [Google Scholar] [CrossRef]
- Cherfils, L.; Fakih, H.; Miranville, A. A Cahn–Hilliard system with a fidelity term for color image inpainting. J. Math. Imag. Vision 2016, 54, 117–131. [Google Scholar] [CrossRef]
- Cherfils, L.; Fakih, H.; Miranville, A. A complex version of the Cahn–Hilliard equation for grayscale image inpainting. SIAM Multiscale Model. Simul. 2017, 15, 575–605. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).