Created
February 17, 2021 13:51
-
-
Save loiseaujc/e338e2ea15ed11b96e7a4fb5ae6501d4 to your computer and use it in GitHub Desktop.
Implementation of basis pursuit denoising with StructuredOptimization.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using StructuredOptimization | |
""" | |
Simple implementation of basis pursuit denoising using StructuredOptimization.jl | |
INPUT | |
----- | |
m, n : Size of the image in both direction. | |
idx : Linear indices of the measured pixels. | |
y : Pixel measurements. | |
λ : (Optional) Sparsity knob. | |
OUTPUT | |
------ | |
x : Estimated image. | |
""" | |
function bpdn(m, n, idx, y ; λ=0.1) | |
# --> Initialize variable. | |
x = Variable(eltype(y), m, n) | |
# --> Solve the compressed sensing problem. | |
@minimize ls(idct(x)[idx] - y) + λ*norm(x, 1) | |
return ~x | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment