JuliaImages / ImageFiltering.jl

Julia implementations of multidimensional array convolution and nonlinear stencil operations
Other
99 stars 51 forks source link

add ROF ADMM solver #238

Open johnnychen94 opened 2 years ago

johnnychen94 commented 2 years ago

This is currently incomplete, the benchmark shows that it's already faster than the MATLAB equivalent version. Yet I think we still have more room for optimization wrt the FFT-related operations, so I opened this draft to see if there are any suggestions on this.

using ImageFiltering, ImageCore, TestImages, ImageShow
using ImageFiltering.Models

img = Float32.(testimage("cameraman"))
noisy_img = img .+ 0.25 .* randn(size(img))

@btime solve_ROF_ADMM($noisy_img, 0.25, 0.02; num_iters=100);
# julia + FFTW v1.1.1: 856.001 ms (104403 allocations: 639.15 MiB)
# julia + FFTW v1.4.5: 1.275 s (8316 allocations: 632.49 MiB)
# matlab: 1.851779s

FFTW has some performance regression here: https://github.com/JuliaMath/FFTW.jl/issues/224

codecov[bot] commented 2 years ago

Codecov Report

Merging #238 (68cbe6d) into master (424523c) will decrease coverage by 2.72%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #238      +/-   ##
==========================================
- Coverage   92.14%   89.42%   -2.73%     
==========================================
  Files          12       12              
  Lines        1642     1692      +50     
==========================================
  Hits         1513     1513              
- Misses        129      179      +50     
Impacted Files Coverage Δ
src/models.jl 43.82% <0.00%> (-56.18%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 424523c...68cbe6d. Read the comment docs.