How to optimize a function ?

1 次查看(过去 30 天)
Rawan hamdi
Rawan hamdi 2013-4-11
Hi, i'm running a denoising algorithm on an image which is 3D image and i'm trying to implement some equations and i need help here's my code:
close all Bands =191; %no of bands
SIZE = [280,307 ,191]; %WxHxBands
lam = 0.063; B=12; X0 = multibandread('dc.tif', SIZE, 'int16',1252*2, 'bsq', 'ieee-le');
%%% Add noise (zero-mean Guassian &Salt and pepper ) % show original and noisy images
std_n=40; var_noise=std_n^2; % Gaussian noise standard deviation reduced_pw = 1.5*var_noise; % power to reduce in first phase %sig_w = 5; ws=4*sig_w+1; std_n=sqrt(var(X0(:))); Xn = randn(size(X0))*std_n; %noise
X = X0 + Xn;
figure;imagesc(abs((squeeze(X0(:,:,[50,35,30]))/max(X0(:))))); title('Original Image');
figure; imagesc(abs((squeeze(X(:,:,[50,35,30]))/max(X(:))))); title('Noisy Image ');%plotting noisy
[Gx,Gy,Gz] = gradient(X);
Rcub = sqrt((Gx.^2) + (Gy.^2) + ((Gz.^2) .*B));
------------------------------------------------------------------- now what i need to implement is this constrained least squares problem and then optimize it here's the equation :
x = argmin=||g-u||.^2+(lambda.*Rcub)
g is the observed noisy image
u is the clean image
Any help would be very appreciated Thanks

回答(1 个)

Alan Weiss
Alan Weiss 2013-4-12
Maybe a documentation example is relevant.
Alan Weiss
MATLAB mathematical toolbox documentation

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by