0 Up votes0 Down votes

234 views8 pagesFor a given input image we perform high pass, low pass, band pass filtering of an image using Matlab code.
Output images are shown along with some observation results.

May 06, 2013

© Attribution Non-Commercial (BY-NC)

PDF, TXT or read online from Scribd

For a given input image we perform high pass, low pass, band pass filtering of an image using Matlab code.
Output images are shown along with some observation results.

Attribution Non-Commercial (BY-NC)

234 views

For a given input image we perform high pass, low pass, band pass filtering of an image using Matlab code.
Output images are shown along with some observation results.

Attribution Non-Commercial (BY-NC)

- Frequency Domain Bandpass Filtering for Image Processing
- M-3
- BE-3b4-ECE-E1_0
- ConnectComp
- ANSI S1.11-1986(ASA 65-1986)
- Image Denoising Method using Oli-Shrink, A New Adaptive Wavelet Packet Thresholding Function
- Gotham G213
- ghz range
- LOWPASS FIR FILTER USING HAMMING WINDOW
- Fir
- Imgae Editor Project Reoprt
- Eua 5202
- HW_CH4(S)
- DC Lecture8
- GPS Signals
- The Audio Critic 28 r
- Zotkin, Duraiswami, Davis - Unknown - Rendering Localized Spatial Audio in a Virtual Auditory Space.pdf
- High-pass Filter
- SIMetrix Training v11
- 11- Oct 2005

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

- Frequency Domain Bandpass Filtering for Image ProcessingUploaded byLeonardo O Iheme
- M-3Uploaded byJacob Murray
- BE-3b4-ECE-E1_0Uploaded byemailshiva
- ConnectCompUploaded byleeofrock
- ANSI S1.11-1986(ASA 65-1986)Uploaded byYo Soy La Resurrecion
- Image Denoising Method using Oli-Shrink, A New Adaptive Wavelet Packet Thresholding FunctionUploaded byIJSTE
- Gotham G213Uploaded byatukbaraza
- ghz rangeUploaded bylathakanthraj
- LOWPASS FIR FILTER USING HAMMING WINDOWUploaded byDeepthi Prabhakaran
- FirUploaded bysrujanang
- Imgae Editor Project ReoprtUploaded byRahul Tonape
- Eua 5202Uploaded byOtoniel Cardenas
- HW_CH4(S)Uploaded byAbd Tash
- DC Lecture8Uploaded byAamir Habib
- GPS SignalsUploaded byDheerajKaushal
- The Audio Critic 28 rUploaded bySteve C.
- Zotkin, Duraiswami, Davis - Unknown - Rendering Localized Spatial Audio in a Virtual Auditory Space.pdfUploaded bySrishti Agarwal
- High-pass FilterUploaded bysiragu
- SIMetrix Training v11Uploaded by曾乙申
- 11- Oct 2005Uploaded byTechnos_Inc
- State Variable to Polo GiaUploaded byHommingHomming
- S5 EC SyllabusUploaded bySrikanth Kodoth
- New Model Lesson PlanUploaded byEugin Raj
- lab reportUploaded byapi-308730292
- Yannis Tsividis, Shanthi Pavan-High Frequency Continuous Time Filters in Digital CMOS (2000).pdfUploaded bySatadal Gupta
- Soundwel AE Product Catalogue (1)Uploaded byHenry Cruz
- Ship Shock Trial Simulation of USS Winston S. Churchill (DDG 81).pdfUploaded byFernando Raúl LADINO
- DSP FinalUploaded byApricot Blueberry
- BF SubbandsUploaded byRobert Kemper
- Kobayashi 2016Uploaded byWoo Yong Choi

- Syllabus BeginnerUploaded byMahesh Gondi
- Filtro MACEUploaded byIgor Mahall Sousa
- Digital Control Theory ProjectUploaded bySayed Abdullah
- NewBFSUploaded byAgus Yang
- New Model Lesson PlanUploaded byEugin Raj
- Numerical Method for engineers-chapter 3Uploaded byMrbudakbaek
- Turbo CodesUploaded byAgung Supe
- Lab RecordUploaded byit hod
- Chapter_4Uploaded byRajendra Prasad Dash
- FFT2 AlgorithmUploaded byMinh Nhật
- iterative-reweighted-least-squares-12 (1).pdfUploaded byVanidevi Mani
- Web Development of AlgorithmUploaded byJohnJayVentula
- D Algorithm NotesUploaded bymujju433
- Operations With MatricesUploaded byamir shaharan
- ('Christos Papadimitriou', 'Midterm 1', '(Solution)') Fall 2009Uploaded byJohn Smith
- 91329-0136097111_ch01Uploaded bykaushik73
- FFTUploaded bysusanta kumar rout
- 8. Electronics - IJECE - Restoration for Weakly Blurred and Strongly Noisy Images - Roshan KuntawadUploaded byiaset123
- Experiment 9Uploaded bySharad Mishra
- Implicit_RK_SIRK.pdfUploaded byD.n.Prasad
- evolutionary algorithms classificationUploaded byBT Krishna
- 2c. Digital Image Processing.pdfUploaded bysa
- HWQ4 AssignmentUploaded byfrankandbooth
- Signal Modeling Techniques in Speech RecognitionUploaded byjehosha
- Chapter4(1)Uploaded byEmanuel Diego
- Lecture 3Uploaded byasdf_1123
- Vlsi_fft Report FinalUploaded bykk0511
- Sorting Algorithms in CUploaded byDeeksha Shankhdher
- IMAGE SEGMENTATION BY USING EDGE DETECTION.docUploaded byArivazhagan Art
- Problem Solving A StarUploaded byMd Golam Morshed

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.