Question

2. (20 marks) Given a noised color image test.jpg, first use media filter to remove noise from R, G, B channels respectively

0 0
Add a comment Improve this question Transcribed image text
Answer #1

% This is the matlab code for the question asked

% save the input image as 'test.jpg' in the same folder where the code is saved

clear all; close all; clc;
test = imread('test.jpg');
imshow(test);
title('Original Test Image')
%% median filtering each channels
outR = medfilt2(test(:,:,1));
outG = medfilt2(test(:,:,2));
outB = medfilt2(test(:,:,3));
%combining channels together
out1 = zeros(size(test),'uint8');
out1(:,:,1) = outR;
out1(:,:,2) = outG;
out1(:,:,3) = outB;

figure, imshow(out1);
title('Image after median filtering');
%% Histogram Equalization of individual channels
outR = histeq(outR);
outG = histeq(outG);
outB = histeq(outB);
%combining different channels together
out2 = zeros(size(out1),'uint8');
out2(:,:,1) = outR;
out2(:,:,2) = outG;
out2(:,:,3) = outB;
figure, imshow(out2);
title('Image after histogram equalization');
%% Robert's operator for edge detection
edgeR = edge(outR,'Roberts');
edgeG = edge(outG,'Roberts');
edgeB = edge(outB,'Roberts');
% ORing all three channels, since output of edge are logical
EdgeImg = edgeR + edgeB + edgeG;
figure, imshow(EdgeImg);
title('Image after applying Roberts operator for edge detection');

Add a comment
Know the answer?
Add Answer to:
2. (20 marks) Given a noised color image test.jpg', first use media filter to remove noise...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT