Code covered by the BSD License
-
Basis Pursuit Denoising with ...
-
Basis Pursuit with Douglas Ra...
-
Constrained Total Variation P...
-
Total Variation Denoising
-
clamp(x,a,b)
-
compute_correlation_error(His...
-
compute_dual_prox(ProxF)
compute_dual_prox - compute the proximal operator of the dual
-
compute_gaussian_filter(n,s,N...
compute_gaussian_filter - compute a 1D or 2D Gaussian filter.
-
compute_operator_norm(A,n)
compute_operator_norm - compute operator norm
-
crop(M,n,c)
crop - crop an image to reduce its size
-
div(Px,Py, options)
div - divergence operator
-
getoptions(options, name, v, ...
getoptions - retrieve options parameter
-
grad(M, options)
grad - gradient, forward differences
-
image_resize(M,p1,q1,r1)
image_resize - resize an image using bicubic interpolation
-
imageplot(M,str, a,b,c)
imageplot - diplay an image and a title
-
load_image(type, n, options)
load_image - load benchmark images.
-
perform_admm(x, K, KS, ProxF...
perform_admm - preconditionned ADMM method
-
perform_blurring(M, sigma, op...
perform_blurring - gaussian blurs an image
-
perform_convolution(x,h, boun...
perform_convolution - compute convolution with centered filter.
-
perform_dr(x,ProxF,ProxG,opti...
perform_dr - Douglas Rachford algorithm
-
perform_fb(x, ProxF, GradG, L...
perform_admm - preconditionned ADMM method
-
perform_fb_strongly(x, K, KS,...
perform_admm - preconditionned ADMM method
-
perform_l1ball_projection(x,l...
perform_l1ball_projection - compute the projection on the L1 ball
-
perform_soft_thresholding(x, ...
perform_soft_thresholding - soft thresholding
-
perform_wavortho_transf(f,Jmi...
perform_wavortho_transf - compute orthogonal wavelet transform
-
progressbar(n,N,w)
progressbar - display a progress bar
-
rescale(x,a,b)
-
s2v(s,a)
s2v - structure array to vector
-
publish_all.m
-
test_fbstrongly_analysis.m
-
View all files
from
Toolbox Sparse Optmization
by Gabriel Peyre
Optimization codes for sparsity related signal processing
|
| crop(M,n,c) |
function M = crop(M,n,c)
% crop - crop an image to reduce its size
%
% M = crop(M,n,c);
%
% n is the new size of the image
% c is the center of the grop
%
% Copyright (c) 2007 Gabriel Peyr?
n0 = size(M);
if nargin<2
n = round( n0(1:2)/2 );
end
if nargin<3 || isempty(c)
c = round( n0(1:2)/2 );
end
if isempty(n)
return;
end
if length(n)==1
n = [n n];
end
if length(c)==1
c = [c c];
end
c = round(c);
selx = c(1)-ceil(n(1)/2)+1:c(1)+floor(n(1)/2);
sely = c(2)-ceil(n(2)/2)+1:c(2)+floor(n(2)/2);
selx(selx<1) = [];
selx(selx>n0(1)) = [];
sely(sely<1) = [];
sely(sely>n0(2)) = [];
M = M(selx,sely,:);
|
|
Contact us at files@mathworks.com