Skip to content

Add Python demo for variational image inpainting with smoothed TV regularization on irregular masks #4137

@jb2178-star

Description

@jb2178-star

Hi all,

I would like to propose a new Python demo for DOLFINx showing variational image inpainting on an irregular mask using a smoothed total variation regularization. This demo would set up the inpainting problem as a nonlinear variational problem. The fidelity term on the known part of the image together with a smoothed TV regularization term on the full domain. It would derive the week form and implement the residual and Jacobian in UFL. For geometry, the plan is to use the Gmsh Python interface to build a conforming unstructured mesh of the full image domain, with the irregular mask boundary represented inside the domain. That would make it possible to tag the known and unknown regions and apply the fidelity term only where image data is available. The solve would use dolfinx.fem.petsc.NonlinearProblem together with PETSc SNES / Newton iteration. I would aim to keep the example self-contained, probably using a synthetic image and mask generated directly in code. I think this could be a useful demo because it combines several pieces of DOLFINx functionality in one example.

If it fits for this project, my assumption is that it would go in the Python demo collection under python/demo/ as a new demo file. A likely scope would be:

  • formulate the smoothed TV inpainting problem
  • derive the weak form
  • generate a conforming mesh with an irregular interior mask/interface
  • tag the relevant regions
  • implement the nonlinear problem in UFL
  • solve it with NonlinearProblem and SNES
  • show basic reconstruction results and diagnostics
  • have documentation

I have tried to use the Slack link mentioned in the project resources, but it said the link was no longer active. I'm opening this issue first to check whether this would be a welcome contribution and whether you would prefer it as a core demo or as an external tutorial.

Sincerely,

Jack Brockett

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions