Eighth Lecture

advertisement
Lecture Eight
Matlab for spatial filtering and intro to DFTs
Figures 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
Imadjust
g=imadjust(f,[low_in,high_in],[low_out,high_out],gamma)
Includes various contract transformations.
Chapter 3
Intensity Transformations
and Spatial Filtering
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
Chapter 3
Intensity Transformations
and Spatial Filtering
Stem and plot
Find out syntax from typing help stem and
help plot in MATLAB.
Chapter 3
Intensity Transformations
and Spatial Filtering
Histeq command
g=histeq(f,hspec)
hspec is a specified histogram.
If you do
g=histeq(f,256)
you get histogram equalization.
Chapter 3
Intensity Transformations
and Spatial Filtering
Chosen Histgram
p( z ) 
a1
2  1
exp(( z  1 ) / 2 ) 
2
1
a2
2  2
exp(( z   2 ) / 2 22 )  k
Values chosen
a 1  1, a 2  0.07, 1  0.15,  2  0.75,  1   2  0.05
T wo concentrated Gaussian peaks,one large, one small
Chapter 3
Intensity Transformations
and Spatial Filtering
Spatial Filters
g=imfilter(f,w,mode,bndry,size)
Mode= ‘corr’ correlation—standard
‘conv’ convolution, w rotated
180 degrees
Chapter 3
Intensity Transformations
and Spatial Filtering
Chapter 3
Intensity Transformations
and Spatial Filtering
Chapter 3
Intensity Transformations
and Spatial Filtering
Chapter 3
Intensity Transformations
and Spatial Filtering
Chapter 3
Intensity Transformations
and Spatial Filtering
Chapter 3
Intensity Transformations
and Spatial Filtering
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.
Chapter 4
Image Enhancement in the
Frequency Domain
Chapter 4
Image Enhancement in the
Frequency Domain
Chapter 4
Image Enhancement in the
Frequency Domain
Chapter 4
Image Enhancement in the
Frequency Domain
Chapter 4
Image Enhancement in the
Frequency Domain
Chapter 4
Image Enhancement in the
Frequency Domain
Fourier Spectrum and Phase
Two images
• Mix up phase and amplitude
Two pictures from another text
Mix up amplitude and phase
Amplitude from 1, phase from 2, amplitude from 2, phase from one.
Download