232 views

Original Title: Low pass filtering, high pass filtering, band pass filtering of an image along with Matlab code.

Uploaded by Kowshik Reddy Biradavolu

- Project New[1]
- ELT-43007 Matlab Ex3
- Analog_LPF_Butterworh_Lecture.ppt
- thornton-guza-jgr83.pdf
- BE Filters
- Dyuthi-T2204.pdf
- Uniform Noise & All Filters(Matlab Code)
- chapter 5 ee 301
- Guidelines for Project Report
- 01468466.pdf
- LinPlug CrX4 Manual
- 3360 Manual
- Notice: Environmental statements; availability, etc.: Base closures and realignments— Real-time imaging spectropolarimeter based on an optical modulator
- pdf_5532
- Frequency Domain Bandpass Filtering for Image Processing
- Ece 306 Final Exam Fall 2014_Solution
- fofdm (2-new)
- atl7
- 4d velocity
- Activity 03

You are on page 1of 8

Low pass, High pass and Band pass filtering of a given Image

http://www.facebook.com/kowshik.biradavolu Page

clc; clear all; thresh=100; im1=imread('gandhi.jpg'); im2=rgb2gray(im1); im=fft(im2); im3=im; [r,c]=size(im); d0=thresh; h=zeros(r,c);

--------------------------> Read the image --------------------------> Converting true colour image to grayscale image --------------------------> Converting image to frequency domain and determining its size

for i=1:r ---------------------------> Code for generating low for j=1:c pass filter function d(i,j)= sqrt( (i-(r/2))^2 + (j-(c/2))^2); end end for i=1:r for j=1:c h(i,j)= exp ( -( (d(i,j)^2)/(2*(d0^2)) ) ); end end for i=1:r for j=1:c res(i,j)=(h(i,j))*im(i,j); end end fres=ifft(res); subplot(2,2,1) imshow(im2,[ ]) title('Original image')` -------------------------> Multiplying every pixel of the image in frequency domain with the corresponding element of the filter function

Page

subplot(2,2,2) imshow(im3) title('Fourier spectrum of image') subplot(2,2,3) imshow(h,[ ]) title('Gaussian lowpass filter response') subplot(2,2,4) imshow(fres,[ ]) title('lowpass filtered image')

OUTPUT :

Page

Code:

clc; clear all; thresh=100; im1=imread('gandhi.jpg'); im2=rgb2gray(im1); im=fft(im2); im3=im; [r,c]=size(im); d0=thresh; h=zeros(r,c);

--------------------------> Read the image --------------------------> Converting true colour image to grayscale image --------------------------> Converting image to frequency domain and determining its size

for i=1:r ---------------------------> Code for generating high for j=1:c pass filter function d(i,j)= sqrt( (i-(r/2))^2 + (j-(c/2))^2); end end for i=1:r for j=1:c h(i,j)=1- exp ( -( (d(i,j)^2)/(2*(d0^2)) ) ); end end for i=1:r for j=1:c res(i,j)=(h(i,j))*im(i,j); end end fres=ifft(res); subplot(2,2,1) imshow(im2,[ ]) title('Original image')` -------------------------> Multiplying every pixel of the image in frequency domain with the corresponding element of the filter function

Page

subplot(2,2,2) imshow(im3) title('Fourier spectrum of image') subplot(2,2,3) imshow(h,[ ]) title('Gaussian highpass filter response') subplot(2,2,4) imshow(fres,[ ]) title('Highpass filtered image')

OUTPUT:

Page

clc; clear all; thresh=100; im1=imread('gandhi.jpg'); im2=rgb2gray(im1); im=fft(im2); im3=im; [r,c]=size(im); d0=thresh; h=zeros(r,c);

--------------------------> Read the image --------------------------> Converting true colour image to grayscale image --------------------------> Converting image to frequency domain and determining its size

for i=1:r ---------------------------> Code for generating band for j=1:c pass filter function d(i,j)= sqrt( (i-(r/2))^2 + (j-(c/2))^2); end end for i=1:r for j=1:c h1(i,j)=1-exp ( -( (d(i,j)^2)/(2*(d0^2)) ) ); h2(i,j)=exp ( -( (d(i,j)^2)/(2*(d1^2)) ) ); h3(i,j)=h1(i,j)+h2(i,j); end end for i=1:r -------------------------> Multiplying every pixel of the for j=1:c image in frequency domain res(i,j)=(h3(i,j))*im(i,j); with the corresponding end element of the filter function end fres=ifft(res); subplot(2,2,1) imshow(im2,[ ]) title('Original image')` --------------------------> Finally taking the inverse fourier transform

Page

subplot(2,2,2) imshow(im3) title('Fourier spectrum of image') subplot(2,2,3) imshow(h,[ ]) title('Gaussian bandpass filter response') subplot(2,2,4) imshow(fres,[ ]) title('bandpass filtered image')

OUTPUT:

Page

Lowpass filter smoothens the image. By reducing the high-frequency components while preserving the low-frequency components, lowpass filtering reduces a large amount of noise at the expense of reducing a small amount of signal.

2. Highpass Filtering:

By highpass filtering image sharpness can be achieved. By increasing the sharpness finite details in the image can be obtained.This filter can also effectively extract the edges contained in an image.

3. Bandpass Filtering:

A bandpass attenuates very low and very high frequencies. Bandpass filtering can be used to enhance edges (suppressing low frequencies) while reducing the noise at the same time (attenuating high frequencies). In case of bandpass filtering there is always a trade-off between blurring and noise.

Page

- Project New[1]Uploaded bySumit Chakraborty
- ELT-43007 Matlab Ex3Uploaded by185534 ktr.ece.14
- Analog_LPF_Butterworh_Lecture.pptUploaded byPraneeth Kumar
- thornton-guza-jgr83.pdfUploaded byjose03
- BE FiltersUploaded byShubham Agiwal
- Dyuthi-T2204.pdfUploaded byNabil Dakhli
- Uniform Noise & All Filters(Matlab Code)Uploaded bySharath Kumar N
- chapter 5 ee 301Uploaded byPrevenaManiam
- Guidelines for Project ReportUploaded byNur Ain Atirah
- 01468466.pdfUploaded bypand2406
- LinPlug CrX4 ManualUploaded byrocciye
- 3360 ManualUploaded byMinKoan Kim
- Notice: Environmental statements; availability, etc.: Base closures and realignments— Real-time imaging spectropolarimeter based on an optical modulatorUploaded byJustia.com
- pdf_5532Uploaded byGdfsndh Gfdvhjzd
- Frequency Domain Bandpass Filtering for Image ProcessingUploaded byLeonardo O Iheme
- Ece 306 Final Exam Fall 2014_SolutionUploaded bylunsfordium
- fofdm (2-new)Uploaded bywan nazmi
- atl7Uploaded byShivpratap Singh
- 4d velocityUploaded byDiego Grungestar Pérez
- Activity 03Uploaded bySasuke
- ca4 - designing and implementing filtersUploaded byapi-223721455
- Digital Image Processing Notes - AkshanshUploaded byAkshansh Chaudhary
- Codec de AudioUploaded byAndres Suarez
- Dsp Assignment 2Uploaded byradhikabaskarscribd
- VII_Sem[1]Uploaded byNarayan Singh Waraich
- 04156403Uploaded byVale Conde Cuatzo
- Question Bank for 5 Units DIP-IT6005Uploaded byRamJiDR
- Gto14001 Om Eng Aug09Uploaded byShaymma Ramphalie-Oudit
- MCT-413_DSP_2010_Lecture # 1.pdfUploaded bySyed Zain Mehdi
- analysis of wavelet domain wiener filtersUploaded byraghuramchandr

- Cisco White Part on EPCUploaded byRavendran Naicker
- Tr 231 (Pdh Drs Issue II Dec 08)Uploaded byanmij
- V15 Apex Precision Power Databook (Complete)Uploaded byHüseyin Murat Polater
- Design AnswersUploaded byMustafa Çağrı Toroslu
- HOLIP INVERTER MANUAL PDFUploaded byRASHID
- ARM-EVBUploaded byluanawandecy
- Mobile Communication presentationUploaded bySakshi Agrawal
- indielUploaded byPablo Palavecino
- Optocoupler TutorialUploaded byAnonymous HXFi2kJRUv
- hgehegUploaded byErika Peterson
- Basics Synchronized EthernetUploaded byDarrylBaron
- Meitrack Mvt100 User Guide v2.7Uploaded byPedro Vargas
- ELTE2.3 DBS3900 LTE FDD Basic Feature DescriptionUploaded byChristian Henke
- MTNL 3gUploaded byAas Babar
- trans1Uploaded byTed Ski
- Piezo Shoes an InnovationUploaded bymichael
- IR DetectorUploaded by16rock9999
- Titan ASL TestUploaded byGianfranco Taco
- Orgone Bioenergy and Radionic CircuitsUploaded byGiannis Fakiris
- 20180531 FiberOptics BrochureUploaded byBurim Qehaja
- Ec 1202 Digital System DesignUploaded byworkub
- APS3-300_APS6-300_500_JUploaded byKonstantin Gorbokon
- Antenna-System-Planning.pdfUploaded byStefán Þór Sigurðsson
- hvdUploaded byNaresh Gopu
- Netis WF-2402Uploaded byOngky Saja
- Answers to QuestionsUploaded byelmerc_207575
- 1-DP_ASI_IFMUploaded bywendelreis19746883
- Electronics_ Working Principle Television (TV)Uploaded bySuman Das
- MAN-0097R3.0, TG350 User ManualUploaded bySylvainsfc
- Https Www.time4education.com Local Articlecms PageUploaded byShailender Yadav