Upload a test image into Matlab. Corrupt the image with a Gaussian noise of zero
ID: 667990 • Letter: U
Question
Upload a test image into Matlab. Corrupt the image with a Gaussian noise of zero mean and different standard deviations. As we saw previously in the class, to get rid of this noise we need to average a number of different copies of the same image that are corrupted with different samples of Gaussian noise with the same standard deviation. Use your qualitative assessment to find the relation between the number of images that need to be averaged to get a good output image and the standard deviation of noise.
Explanation / Answer
uMax = max(u(:));
uMin = min(u(:));
uPower = sum(u(:).^2);
uAvg = mean(u(:));
uVar = var(u(:));
uMed = median(u(:));
hist(u(:),linspace(0,1,256));
uClip = min(max(u,0),1);
uPad = u([1,1:end,end],[1,1:end,end]);
uPad = padarray(u,[k,k],'replicate');
uCrop = u(RowStart:RowEnd,ColStart:ColEnd);
uFlip = flipud(u);
uFlip = fliplr(u);
uResize = imresize(u,ScaleFactor);
uRot = rot90(u,k);
uRot = imrotate(u,Angle);
uc = (u - min(u(:))/(max(u(:)) - min(u(:)));
uq = round(u*(K-1))/(K-1);
% Simulating noise
uNoisy = u + randn(size(u))*sigma; % Add white Gaussian noise of standard deviation sigma
uNoisy = u; uNoisy(rand(size(u)) < p) = round(rand(size(u))); % Salt and pepper noise
% Debugging
any(~isfinite(u(:))) % Check if any elements are infinite or NaN
nnz(u > 0.5) % Count how many elements satisfy some condition
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.