Image Enhancement Technique in Frequency Filters using MATLAB with Source Code
Image Enhancement Technique in Frequency Filter using MATLAB with Source Code
Digital Image Processing Using MATLAB
Enhancement in Frequency Domain Filtering
Spatial Domain
Frequency Domain
Major filter categories
Naturally, filters are categorized by examining their properties in the frequency domain:
Low-pass
High-pass
Band-pass
Band-stop
Example
Low-pass filters (Smoothing Filters):
Low-pass filters also known as called Smoothing Filters
Preserve low frequencies - useful for noise suppression
Example:
High-pass filters (Sharpening Filters)
High-pass filters also known as called Sharpening Filters
Preserves high frequencies - useful for edge detection
Example
Band-Stop filters
Frequency Domain Methods
Case 1: h(u,v) is stated in the frequency domain.
Case 2: h(x,y) is stated in the spatial domain.
Frequency domain filtering:
STEPS
F(u,v) = R(u,v) + jI(u,v)
G(u,v)= F(u,v)H(u,v) = H(u,v) R(u,v) + jH(u,v)I(u,v)
Types of Low Pass (LP) Filters
Ideal low-pass filter (ILPF)
Butterworth low-pass filter (BLPF)
Gaussian low-pass filter (GLPF)
Types of High Pass (LP) Filters
Ideal high-pass filter (IHPF)
Butterworth high-pass filter (BHPF)
Gaussian high-pass filter (GHPF)
Difference of Gaussians
Unsharp Masking and High Boost filtering
MATLAB Source Code For Image Enhancement in Frequency Filtering
%LOW PASS FILTER
clc;
clear all;
close all;
a=imread('coins.png');
[m,n]=size(a);
mask=zeros(m,n);
for i=150:180
for j=210:240
mask (i,j)=i;
end
end
c=fftshift(mask);
b=fft2(a);
d=b.*c;
e=abs(ifft2(b));
figure(1);
subplot(3,3,1);
imshow(a);
title('original image');
subplot(3,3,2);
imshow(uint8(e));
title('low passs filtered image');
subplot(3,3,3);
imshow(mask);
subplot(3,3,4);
imshow(c);
title('mask after fftshift ooperation');
%HIGH PASS FILTER
a=imread('coins.png');
[m,n]=size(a);
mask=ones(m,n);
for i=150:180
for j=210:240
mask (i,j)=0;
end
end
c=fftshift(mask);
b=fft2(a);
d=b.*c;
e=abs(ifft2(b));
subplot(3,3,5);
imshow(a);
title('original image');
subplot(3,3,6);
imshow(uint8(e));
title('high pass filtered image');
subplot(3,3,7);
imshow(mask);
subplot(3,3,8);
imshow(c);
title('high pass filter mask');
%BAND PASS PASS FILTER
a=imread('coins.png');
[m,n]=size(a);
mask=zeros(m,n);
for i=160:170
for j=260:230
mask (i,j)=0;
end
end
c=fftshift(mask);
b=fft2(a);
d=b.*c;
e=abs(ifft2(b));
figure(2);
subplot(2,2,1);
imshow(a);
title('original image');
subplot(2,2,2);
imshow(uint8(e));
title('band pass filtered image');
subplot(2,2,3);
imshow(uint8(mask));
subplot(2,2,4);
imshow(uint8(c));
title('mask after fftshift ooperation');
% BAND REJECT FILTER
a=imread('coins.png');
[m,n]=size(a);
mask=ones(m,n);
for i=150:180
for j=210:240
mask(i,j)=0;
end
end
c=fftshift(mask);
b=fft2(a);
d=b.*c;
e=abs(ifft2(b));
figure(3);
subplot(2,2,1);
imshow(a);
title('original image');
subplot(2,2,2);
imshow(uint8 (e));
title('band reject pass filtered image');
subplot(2,2,3);
imshow(mask);
subplot(2,2,4);
imshow(c);
title('high pass filter mask');
Result
Thank you for providing this data. I was looking for a band reject filter a few months ago and looked in several places. However the price was so high at a few nearby locations, I decided to look for the best website for band reject filter on the internet. Finally I acquired all of my essential band reject filter from Anatech Electronics at the best ever price, and I also placed an order for a custom band reject filter, which I received on time. If you're looking for a band reject filter, I recommend Anatech Electronics for everyone.
ReplyDelete