From 34bc097ee7d2cb3048386998752574888beea6a5 Mon Sep 17 00:00:00 2001
From: Stephan Hilb <stephan@ecshi.net>
Date: Mon, 20 Jun 2022 14:51:24 +0200
Subject: [PATCH] use nodal interpolation for inpaint and fine mesh

---
 scripts/run_experiments.jl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scripts/run_experiments.jl b/scripts/run_experiments.jl
index f5b1481..2117e46 100644
--- a/scripts/run_experiments.jl
+++ b/scripts/run_experiments.jl
@@ -1354,13 +1354,15 @@ function inpaint(ctx)
         if ctx.params.n_refine == 0
             # if we use a grid at image resolution, we wan't to avoid
             # information loss at all cost.
-            # projet_l2_pixel is not suited for inpainting as it is a global
+            # project_l2_pixel is not suited for inpainting as it is a global
             # operator, which may leak data from the inpainting domain
             interpolate!(st.g, x -> evaluate_bilinear(g_arr, x))
+            interpolate!(st.tdata, x -> evaluate_bilinear(mask_arr, x))
         else
             project_image!(st.g, g_arr)
+            # TODO: maybe a more conservative choice would be good
+            project_image!(st.tdata, mask_arr)
         end
-        project_image!(st.tdata, mask_arr)
     end
 
     save_step(i) =
-- 
GitLab