Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods,...
-
Upload
reynold-day -
Category
Documents
-
view
217 -
download
0
Transcript of Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods,...
![Page 1: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/1.jpg)
Lecture Eight
Matlab for spatial filtering and intro to DFTsFigures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez,
Woods, and Eddins, Digital Image Processing with MATLAB, Copyright, 2004, and
Jahne, Digital Image Processing, 4th Edition, Copyright, 1997
![Page 2: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/2.jpg)
Imadjust
g=imadjust(f,[low_in,high_in],[low_out,high_out],gamma)
Includes various contract transformations.
![Page 3: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/3.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 4: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/4.jpg)
Logarithmic and Constrast Transformations
g=c*log(1+double(f))
gs=im2uint8(mat2gray(g)); % to range [0,1] and to gray scale
Contrast transformation
g=1./(1+(m./(double(f)+eps)).^E)
Use of eps prevents overflow if f has any zero values
m is turning point
![Page 5: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/5.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 6: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/6.jpg)
Stem and plot
Find out syntax from typing help stem and help plot in MATLAB.
![Page 7: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/7.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 8: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/8.jpg)
Histeq command
g=histeq(f,hspec)
hspec is a specified histogram.
If you do
g=histeq(f,256) you get histogram equalization.
![Page 9: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/9.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 10: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/10.jpg)
Chosen Histgram
small one large, one peaks,Gaussian edconcentrat Two
05.0 ,75.0 ,15.0 ,07.0a ,1a
chosen Values
)2/)(exp(2
)2/)(exp(2
)(
212121
222
2
2211
1
1
kza
za
zp
![Page 11: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/11.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 12: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/12.jpg)
Spatial Filters
g=imfilter(f,w,mode,bndry,size)
Mode= ‘corr’ correlation—standard
‘conv’ convolution, w rotated
180 degrees
![Page 13: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/13.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 14: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/14.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 15: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/15.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 16: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/16.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 17: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/17.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 18: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/18.jpg)
Chapter 3Intensity Transformations
and Spatial Filtering
Chapter 3Intensity Transformations
and Spatial Filtering
![Page 19: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/19.jpg)
Fourier Transforms
Based on notion Fourier introduced to Heat transfer that any periodic function can be written as a possibly infinite sum of sines and cosines. Important in
• Differential equations• Probability and statistics (characteristic functions, proof
of central limit theorem)• Almost any area of engineering you can name.
![Page 20: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/20.jpg)
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
![Page 21: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/21.jpg)
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
![Page 22: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/22.jpg)
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
![Page 23: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/23.jpg)
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
![Page 24: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/24.jpg)
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
![Page 25: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/25.jpg)
Chapter 4Image Enhancement in the
Frequency Domain
Chapter 4Image Enhancement in the
Frequency Domain
![Page 26: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/26.jpg)
Fourier Spectrum and Phase
Two images
• Mix up phase and amplitude
![Page 27: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/27.jpg)
Two pictures from another text
![Page 28: Lecture Eight Matlab for spatial filtering and intro to DFTs Figures from Gonzalez and Woods, Digital Image Processing, Copyright 2002, Gonzalez, Woods,](https://reader036.fdocuments.in/reader036/viewer/2022062422/56649f175503460f94c2ea05/html5/thumbnails/28.jpg)
Mix up amplitude and phase
Amplitude from 1, phase from 2, amplitude from 2, phase from one.