Skip to main content
Log in

An efficient and explicit local image inpainting method using the Allen–Cahn equation

  • Published:
Zeitschrift für angewandte Mathematik und Physik Aims and scope Submit manuscript

Abstract

Image inpainting is the process of restoring damaged areas in an image using information available from neighboring regions. In this paper, we present a novel, efficient, and simple local image inpainting algorithm based on the Allen–Cahn (AC) equation with a fidelity term. We utilize the phase separation property of the AC equation and introduce a new phase-dependent fidelity parameter to preserve the original values in the neighboring regions of an inpainting region. The governing partial differential equation is solved using the finite difference method, with the values of the neighboring cells serving as the Dirichlet boundary condition. The proposed algorithm is both local and explicit, making it is fast and easy to implement. We demonstrate the performance of the proposed model through several numerical experiments. Furthermore, comparing this method to other image inpainting methods demonstrates its superiority in image inpainting.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

References

  1. Bertalmio, M., Sapiro, G., Caselles, V., Ballester, C.: Image inpainting. In: Proceedings of the 27th annual conference on Computer graphics and interactive techniques. 417-424 (2000)

  2. Bertalmio, M., Vese, L., Sapiro, G., Osher, S.: Simultaneous structure and texture image inpainting. IEEE T. Image Process. 12(8), 882–889 (2003)

    Article  Google Scholar 

  3. Chan, R., Shen, L., Shen, Z.: A framelet-based approach for image inpainting. preprint. 4, 325 (2005)

  4. Chan, T.F., Shen, J.: Variational image inpainting. Commun. Pure Appl. Math. J. Issued Courant Inst. Math. Sci. 58(5), 579–619 (2005)

    Article  MathSciNet  Google Scholar 

  5. Chan, T.F., Shen, J., Zhou, H.M.: Total variation wavelet inpainting. J. Math. Imaging Vis. 25(1), 107–125 (2006)

    Article  MathSciNet  Google Scholar 

  6. Bugeau, A., Bertalmío, M., Caselles, V., Sapiro, G.: A comprehensive framework for image inpainting. IEEE T. Image Process. 19(10), 2634–2645 (2010)

    Article  MathSciNet  Google Scholar 

  7. Steffens, C.R., Messias, L.R., Drews-Jr, P.J., Botelho, S.S.D.C.: CNN based image restoration. J. Intell. Robot. Syst. 99(3), 609–627 (2020)

    Article  Google Scholar 

  8. Chang, H.H., Chen, P.F., Guo, J.K., Sung, C.C.: A self-adaptive single underwater image restoration algorithm for improving graphic quality. EURASIP J. Image Vide. 2020(1), 1–21 (2020)

    Google Scholar 

  9. Liu, G., Li, X., Wei, J.: Large-area damage image restoration algorithm based on generative adversarial network. Neural Comput. Appl. 33(10), 4651–4661 (2021)

    Article  Google Scholar 

  10. Carrillo, J.A., Kalliadasis, S., Liang, F., Perez, S.P.: Enhancement of damaged image prediction through Cahn–Hilliard image inpainting. R. Soc. Open Sci. 8, 201294 (2021)

    Article  Google Scholar 

  11. Zhang, K., Crooks, E., Orlando, A.: Compensated convexity methods for approximations and interpolations of sampled functions in euclidean spaces: applications to contour lines, sparse data, and inpainting. SIAM J. Imaging Sci. 11(4), 2368–2428 (2018)

    Article  MathSciNet  Google Scholar 

  12. Wang, N., Ma, S., Li, J., Zhang, Y., Zhang, L.: Multistage attention network for image inpainting. Pattern Recognit. 106, 107448 (2020)

    Article  Google Scholar 

  13. Elharrouss, O., Almaadeed, N., Al-Maadeed, S., Akbari, Y.: Image inpainting: a review. Neural Process. Lett. 51(2), 2007–2028 (2020)

    Article  Google Scholar 

  14. Thanh, D.N.H., Prasath, V.S., Dvoenko, S.: An adaptive image inpainting method based on euler’s elastica with adaptive parameters estimation and the discrete gradient method. Signal Process. 178, 107797 (2021)

    Article  Google Scholar 

  15. Cahn, J.W.: Phase separation by spinodal decomposition in isotropic systems. J. Chem. Phys. 42(1), 93–99 (1965)

    Article  Google Scholar 

  16. Allen, S.M., Cahn, J.W.: A microscopic theory for antiphase boundary motion and its application to antiphase domain coarsening. Acta Metall. 27(6), 1085–1095 (1979)

    Article  Google Scholar 

  17. Zou, Q.: An image inpainting model based on the mixture of Perona–Malik equation and Cahn–Hilliard equation. J. Appl. Math. Comput. 66, 21–38 (2021)

    Article  MathSciNet  Google Scholar 

  18. Li, Y., Jeong, D., Choi, J.I., Lee, S., Kim, J.: Fast local image inpainting based on the Allen–Cahn model. Digital Signal Process. 37, 65–74 (2015)

    Article  Google Scholar 

  19. Zhang, M., Zhang, G.F.: Fast image inpainting strategy based on the space-fractional modified Cahn–Hilliard equations. Comput. Math. with Appl. 102, 1–14 (2021)

    Article  MathSciNet  Google Scholar 

  20. Halim, A., Kumar, B.R.: An anisotropic PDE model for image inpainting. Comput. Math. Appl. 79(9), 2701–2721 (2020)

    Article  MathSciNet  Google Scholar 

  21. Li, Y., Xia, Q., Lee, C., Kim, S., Kim, J.: A robust and efficient fingerprint image restoration method based on a phase-field model. Pattern Recognit. 123, 108405 (2022)

    Article  Google Scholar 

  22. Brkić, A.L., Mitrović, D., Novak, A.: On the image inpainting problem from the viewpoint of a nonlocal Cahn–Hilliard type equation. J. Adv. Res. 25, 67–76 (2020)

    Article  Google Scholar 

  23. Qiao, Y., Zhai, S., Feng, X.: Operator splitting method based on image restoration of Allen–Cahn equation. Chin. J. Eng. Math. 35(6), 722–732 (2019)

    Google Scholar 

  24. Bertozzi, A.L., Esedoglu, S., Gillette, A.: Inpainting of binary images using the Cahn–Hilliard equation. IEEE Trans. Image Process. 16(1), 285–291 (2006)

    Article  MathSciNet  Google Scholar 

  25. Bosc, J., Kay, D., Stoll, M., Wathen, A.: Fast solvers for Cahn–Hilliard inpainting. SIAM J. Imaging Sci. 7(1), 67–97 (2014)

    Article  MathSciNet  Google Scholar 

  26. Li, Y., Jeong, D., Choi, J.I., Lee, S., Kim, J.: Fast local image inpainting based on the Allen–Cahn model. Digit. Signal Process. 37, 65–74 (2015)

    Article  Google Scholar 

Download references

Acknowledgements

The first author Jian Wang expresses thanks for the Natural Science Foundation of the Jiangsu Higher Education Institutions of China (Grant Nos. 22KJB110020). The corresponding author (J.S. Kim) was supported by the National Research Foundation(NRF), Korea, under project BK21 FOUR. We would like to extend our deepest gratitude to the reviewers for their invaluable comments and suggestions that greatly improved the quality of this manuscript.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Junseok Kim.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wang, J., Han, Z. & Kim, J. An efficient and explicit local image inpainting method using the Allen–Cahn equation. Z. Angew. Math. Phys. 75, 44 (2024). https://doi.org/10.1007/s00033-023-02184-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s00033-023-02184-6

Keywords

Navigation