@@ -3,7 +3,6 @@ export generate_uniform_blur, generate_gaussian_blur
33"""
44Implementation of the denoising problem described in
55
6- <<<<<<< HEAD
76Stella, L., Themelis, A. & Patrinos, P.
87Forward–backward quasi-Newton methods for nonsmooth optimization problems.
98Comput Optim Appl 67, 443–487 (2017). https://doi.org/10.1007/s10589-017-9912-y
@@ -14,16 +13,6 @@ Chouzenoux, E., Martin, S. & Pesquet, JC.
1413A Local MM Subspace Method for Solving Constrained Variational Problems in Image Recovery.
1514J Math Imaging Vis 65, 253–276 (2023). https://doi.org/10.1007/s10851-022-01112-z
1615"""
17- # non-allocating reshape
18- # see https://github.com/JuliaLang/julia/issues/36313
19- reshape_array (a, dims) = invoke (Base. _reshape, Tuple{AbstractArray, typeof (dims)}, a, dims)
20- ====== =
21- Chouzenoux, E., Martin, S. & Pesquet, JC.
22- A Local MM Subspace Method for Solving Constrained Variational Problems in Image Recovery.
23- J Math Imaging Vis 65 , 253 –276 (2023 ). https: // doi. org/ 10.1007 / s10851- 022 - 01112 - z
24-
25- """
26- >>>>>>> 11df75c (Update project.toml and reduce allocations)
2716
2817# Function to unpad an array
2918function unpad (x, n_p, m_p, n)
6150# Function to generate a Gaussian kernel
6251function my_gaussian_kernel (kernel_size, kernel_sigma)
6352 x, y = meshgrid ((- kernel_size): kernel_size, (- kernel_size): kernel_size)
64- <<<<<<< HEAD
65- normal = 1 / (2 * pi * kernel_sigma^2)
66- kernel = exp(-((x ^ 2 + y ^ 2) / (2 * kernel_sigma^2))) * normal
67- kernel ./= sum(kernel)
68- =======
6953 normal = 1 / (2.0 * pi * kernel_sigma^ 2 )
70- <<<<<<< HEAD
71- kernel = exp.(-((x .^ 2 + y .^ 2) / (2.0 * kernel_sigma^2))) * normal
72- kernel .= kernel / sum(kernel)
73- >>>>>>> 11df75c (Update project.toml and reduce allocations)
74- =======
7554 kernel = exp .(- ((x .^ 2 .+ y .^ 2 ) / (2.0 * kernel_sigma^ 2 ))) * normal
7655 kernel ./= sum (kernel)
77- >>>>>>> a8c1f29 (denoising data remove extra allocation)
7856 return kernel
7957end
8058
0 commit comments