diff --git a/src/mesh.jl b/src/mesh.jl index 3ccf9abec487d34bfdbe47e4a7ac4c45370ab305..98a96a6788a695ee68dd8861b975a312431b0dcc 100644 --- a/src/mesh.jl +++ b/src/mesh.jl @@ -358,7 +358,7 @@ function test_mesh(mesh) edgemap[e3] = push!(get!(edgemap, e3, []), cell) end for (edge, cells) in edgemap - @assert(length(cells) <= 2) + @assert(1 <= length(cells) <= 2) end # are cells positively oriented? for cell in cells(mesh) diff --git a/src/run.jl b/src/run.jl index b4c75c9162d874270c5cfe56a1cc6708fea40a16..7fef3a5a8bf6f36e38c3b9d4a127a66897efd678 100644 --- a/src/run.jl +++ b/src/run.jl @@ -117,6 +117,7 @@ function step!(ctx::L1L2TVContext) print("solve ... ") ctx.du.data .= A \ b + # solve dp1 function dp1_update(x; g, u, p1, du, tdata) m1 = max(gamma1, norm(T(tdata, u) - g)) @@ -332,7 +333,7 @@ function denoise(img; name, params...) ctx = L1L2TVContext(name, mesh, m; T, tdata = nothing, S, params...) interpolate!(ctx.g, x -> interpolate_bilinear(img, x)) - m = size(img) ./ 2 + m = (size(img) .- 1) ./ 2 .+ 1 interpolate!(ctx.g, x -> norm(x .- m) < norm(m) / 3) save_denoise(ctx, i) =