Aim:- Image Enhancement Statistical Filters
MSc Computer Science Image Processing Practical No. 3
Index of all Practicals ~ Click Here
Code:- Image_enh_stats_filters.m
Output:-
MSc Computer Science Image Processing Practical No. 3
Index of all Practicals ~ Click Here
Code:- Image_enh_stats_filters.m
clc;clear all;close all;
% ******** MEAN FILTER ********
f = imread('moon.tif');
subplot(2,2,1);
imshow(f);
title('Original Image');
m = mean2(double(f));
g = imfilter(f,m);
k = imabsdiff(f,g);
subplot(2,2,2);
imshow(g);
title('Mean Filtered Image');
subplot(2,2,3);
imshow(k);
title('Absolute Difference of f ang g');
% ******** MEAN FILTER ********
f = imread('moon.tif');
subplot(2,2,1);
imshow(f);
title('Original Image');
m = mean2(double(f));
g = imfilter(f,m);
k = imabsdiff(f,g);
subplot(2,2,2);
imshow(g);
title('Mean Filtered Image');
subplot(2,2,3);
imshow(k);
title('Absolute Difference of f ang g');
% ******** MEDIAN FILTER ********
figure;
f = imread('moon.tif');
g = imnoise(f,'salt & pepper',0.06);
subplot(1,2,1);
imshow(g);
title('Input Image');
%K = filter2(fspecial('average',3),g)/255;
M = medfilt2(g,[3 3]);
%figure, imshow(K)
subplot(1,2,2);
imshow(M);
title('Median filtered image');
figure;
f = imread('moon.tif');
g = imnoise(f,'salt & pepper',0.06);
subplot(1,2,1);
imshow(g);
title('Input Image');
%K = filter2(fspecial('average',3),g)/255;
M = medfilt2(g,[3 3]);
%figure, imshow(K)
subplot(1,2,2);
imshow(M);
title('Median filtered image');
% ******** MINIMAX FILTER ********
figure;
f = imread('moon.tif');
subplot(1,2,1);
imshow(f);
title('Original Image');
n = 5; % Filter order
freq = [0 0.4 0.5 1]; % Frequency band edges
a = [1 1 0 0]; % Desired amplitudes
b = remez(n,freq,a);
L = imfilter(f,b);
subplot(1,2,2);
imshow(L);
title('Mini-max Filtered Image');
figure;
f = imread('moon.tif');
subplot(1,2,1);
imshow(f);
title('Original Image');
n = 5; % Filter order
freq = [0 0.4 0.5 1]; % Frequency band edges
a = [1 1 0 0]; % Desired amplitudes
b = remez(n,freq,a);
L = imfilter(f,b);
subplot(1,2,2);
imshow(L);
title('Mini-max Filtered Image');
Output:-
Some robberies are done by teams, though, so adjusting for that, the authors conclude that bank robberies yield “a very modest £12,706.60 per person per raid.” feng shui
ReplyDelete