MATLAB code for denoising by averaging video frames (Re: Zimmerman video discussion)


rng(1);
s = zeros(100,100);
s(50,48:52) = ones(1,5);
figure;
imagesc(s); colormap gray; axis image;
title('1x5 line of 1''s on a background of 0''s','fontsize',16);
 
noisy = 4*rand(100,100,100);
for i=1:100
    noisy(i,50,48:52) = noisy(i,50,48:52)+ones(1,1,5);
end;
 
figure;
noisy_2D = zeros(100,100);
noisy_2D(:,:) = noisy(1,:,:);
imagesc(noisy_2D);
title('a noisy image: additive iid U[0,4] noise','fontsize',16);
colormap gray; axis image;
 
denoised_3 = zeros(100,100);
for i=1:3
    noisy_temp(:,:) = noisy(i,:,:);
    denoised_3 = denoised_3 + noisy_temp;
end;
 
denoised_3 = denoised_3/3;
 
figure;
imagesc(denoised_3);
colormap gray; axis image;
title('denoised by averaging three images','fontsize',16);
 
denoised_100 = zeros(100,100);
for i=1:100
    noisy_temp(:,:) = noisy(i,:,:);
    denoised_100 = denoised_100 + noisy_temp;
end;
 
denoised_100 = denoised_100/100;
 
figure;
imagesc(denoised_100);
colormap gray; axis image;
title('denoised by averaging 100 images','fontsize',16);

back to Zimmerman video discussion

Alumni Liaison

Sees the importance of signal filtering in medical imaging

Dhruv Lamba, BSEE2010