| 9 test_deblur |
9 test_deblur |
| 10 |
10 |
| 11 # Dependencies |
11 # Dependencies |
| 12 using Printf |
12 using Printf |
| 13 using FileIO |
13 using FileIO |
| |
14 using ImageCore # We don't use ImageCore, but Julia is fiddly and fails if don't import ImageCore |
| 14 using ColorTypes: Gray |
15 using ColorTypes: Gray |
| 15 # ColorVectorSpace is only needed to ensure that conversions |
16 # ColorVectorSpace is only needed to ensure that conversions |
| 16 # between different ColorTypes are defined. |
17 # between different ColorTypes are defined. |
| 17 import ColorVectorSpace |
18 import ColorVectorSpace |
| 18 import TestImages |
19 import TestImages |
| 76 # Parameters for this experiment |
77 # Parameters for this experiment |
| 77 params = default_params ⬿ denoise_params ⬿ kwargs |
78 params = default_params ⬿ denoise_params ⬿ kwargs |
| 78 params = params ⬿ (save_prefix = save_prefix * "denoise_" * params.image_name,) |
79 params = params ⬿ (save_prefix = save_prefix * "denoise_" * params.image_name,) |
| 79 |
80 |
| 80 # Load image and add noise |
81 # Load image and add noise |
| 81 b = Float64.(Gray.(TestImages.testimage(params.image_name))) |
82 b = Float64.(Gray{Float64}.(TestImages.testimage(params.image_name))) |
| 82 b_noisy = b .+ params.noise_level.*randn(size(b)...) |
83 b_noisy = b .+ params.noise_level.*randn(size(b)...) |
| 83 |
84 |
| 84 # Launch (background) visualiser |
85 # Launch (background) visualiser |
| 85 st, iterate = initialise_visualisation(visualise) |
86 st, iterate = initialise_visualisation(visualise) |
| 86 |
87 |