Complete this in matlab language. The routine takes a noisy image(in grayscale f
ID: 3734441 • Letter: C
Question
Complete this in matlab language. The routine takes a noisy image(in grayscale format of type uint8) as input and attempts to remove the noise with an arithmetic mean filter. A 3x3 window is used to filter the noisy image. The output image type should be uint8.
Code:
Function Im=arithmetic_mean_filter(NoisyIm,d)
%check if the noisy image is grayscale and of uint8
assert_grayscale_image(NoisyIm);
assert_uint8_image(NoisyIm);
%filter the noisy image with arithmetic mean filter. Using 3x3 window to filter the image
Im=?
Explanation / Answer
Function lm = airthmatic_mean_filter(Noisylm,d)
assert_grayscale_image(Noisylm);
assert_uint8_image(Noisylm);
Noisy = imread(Noisylm);
[r,c] = size(Noisy);
for i=2:r-1
for j=2:c-1
lm(i,j) = ceil(sum(sum(Noisy(i-1:i+1,j-1:j+1)))/9);
end
end
end
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.