5.7 Filtering
주파수 영역에서 특정 주파수 부분을 조작(수정, 삭제, 추가)
공간 영역에서 마스크 기반의 영상처리는 간단하고 빠르다.그러나, 공간 영역에서의 고주파, 저주파 분리의 어려움이 있다.
Lowpass filter
removing high frequency information Î blurring an image
Highpass filter
removing low frequency information Î sharpening an image
Bandpass filter
removing specific part of frequency information Î removing unwanted noise
(page 231)
5.7.1 Lowpass Filters
frequency
gain
f0
cutoff frequency
passband
stopband
(a) 1-D lowpass ideal filter (b) 2-D lowpass ideal filter
u v
gain
frequency
gain
f0
cutoff frequency
Transition
(c) 1-D lowpass non-ideal filter (d) 2-D lowpass non-ideal filter
(e) 2-D lowpass ideal filter for Walsh-Hadamard and Cosine
transform
[ ( , ) ( , ) ]
) ,
( r c T
1T u v H u v I
fil=
−filter function filtered image transform
point-by-point method
) 0 , 0 ( ) 0 , 0
( H
T T(0,1)H(0,1)
(a)Original image (b)Filtered image (non-ideal lowpass filter) Blurring that softens the image
(b)Filtered image (ideal lowpass filter) Ripple artifacts at boundaries
Frequency cutoff=32
Butterworth filter
A commonly used non-ideal filter
With the Butterworth filter we can specify the order of the filter, which determines how steep the slope is in the transition of the filter function
A higher order to the filter creates a steeper slope, and the closer we get to an ideal filter
n
f v u
v u
H
20 2 2
1 ) 1 , (
⎥ ⎥
⎦
⎤
⎢ ⎢
⎣
⎡ +
+
=
= 1
n
c) Fourier spectrum, filter order = 3
a) Fourier spectrum, filter order = 1
b) Resultant image with order =1
d) Resultant image with order =3
e) Fourier spectrum, filter order = 5
g) Fourier spectrum, filter order = 8
f) Resultant image with order =5
h) Resultant image with order =8
Lowpass Butterworth Filtering Various Filter Orders
n
f v u v
u
H 2
0 2 2
1 ) 1 , (
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡ +
+
=
Butterworth Lowpass Filtering
(Filter Order = 3, Various Cutoff Frequencies)
a) Fourier spectrum, cutoff frequency = 64
b) Resultant image with cutoff frequency = 64
c) Fourier spectrum, cutoff frequency = 32
d) Resultant image with cutoff frequency = 32
e) Fourier spectrum, cutoff frequency = 16
g) Fourier spectrum, cutoff frequency = 8 f) Resultant image with
cutoff frequency = 16
h) Resultant image with cutoff frequency = 8
n
f v u v
u
H 2
0 2 2
1 ) 1 , (
⎥⎥
⎦
⎤
⎢⎢
⎣
⎡ +
+
=
5.7.2 Highpass Filters
frequency
gain
(a) 1-D highpass ideal filter
frequency
gain
(c) 1-D highpass non-ideal filter
(b) 2-D highpass ideal filter
(d) 2-D highpass non-ideal filter
A highpass filter will keep high frequency information, which corresponds to areas of rapid change in brightness, such as edges or fine textures and attenuate low
frequencies
Used for edge enhancement, since it passes only high frequency information
n
v u
f v
u
H
22 2
1
0) 1 , (
⎥ ⎦
⎢ ⎤
⎣
⎡ + +
=
(e) 2-D highpass ideal filter for Walsh-Hadamard and Cosine
transform
a) Original image b) Butterworth filter;
order = 2; cutoff = 32
c) Ideal filter; cutoff = 32
High-frequency emphasis(고주파 강조) filter
This filter function boosts the high frequencies and retains some of the low frequency information and by adding an offset value to the function
Therefore we do not lose the overall image information
frequency
gain
(a) Ideal highpass emphasis filter for 1-D
frequency
gain
(c) non-ideal highpass emphasis filter for 1-D
(b) Ideal highpass emphasis filter for 2-D
(d) non-ideal highpass emphasis filter for 2-D Offset
Offset
a) Original image b) Butterworth filter;
order = 2; cutoff = 32
c) Ideal filter; cutoff = 32
d) High-frequency emphasis filter;
offset = 0.5, order = 2, cutoff = 32
e) High frequency emphasis filter;
offset = 1.5, order = 2, cutoff = 32
5.7.3 Bandpass and Bandreject Filters
Bandpass filter
It retains specific parts of the spectrum (특정 부분 남김)
Bandreject filter
It removes specific parts of the spectrum (특정 부분 제거)
Bandreject filters are often used for noise removal
Bandpass and bandreject filters
They require high and low frequency cutoff values
They are typically used in image restoration(복원), en hancement(개선), and compression(압축)
frequency
gain
High cutoff Low
cutoff
frequency
gain
High cutoff Low
cutoff
a) bandpass filter
d) bandreject filter
frequency
gain
High cutoff Low
cutoff
frequency
gain
High cutoff Low
cutoff
a) 1-D ideal bandpass filter
d) 1-D ideal bandreject filter
b) 2-D ideal bandpass filter
e) 2-D ideal bandreject filter
c) 2-D ideal notch filter for rejecting specific frequencies
c) 2-D ideal notch filter for passing specific frequencies
목차
5.1 Introduction
5.2 Fourier Transform
5.2.1 The One-Dimensional Discrete Fourier Transform 5.2.2 The Two-Dimensional Discrete Fourier Transform 5.2.3 Fourier Transform Properties
5.2.4 Displaying the Fourier Spectrum 5.3 Cosine Transform
5.4 Walsh-Hadamard Transform 5.7 Filtering
5.7.1 Lowpass Filters 5.7.2 Highpass Filters
5.7.3 Bandpass and Bandreject Filters 5.6 Principal Components Transform 5.5 Haar Transform
5.8 Wavelet Transform
5.6 Principal Components Transform
Mathematically, it involves finding eigenvectors of covariance matrix It decomposes the image into its principal components
Î이미지 공분산의 특징벡터로부터 이미지의 기본요소(시각적)만을 찾아냄
It differs from the transforms considered so far, as it is not related to extracting frequency or sequency information from images
Used to find optimal basis images for a specific image, but this use of it is not very practical due to the extensive processing required (광범위한 연산-실용적이지 못함)
a) Red band of a color image b) Green band c) Blue band
d) Principal component band 1 e) Principal component band 2 f) Principal component band 3
The three step procedure for finding the PCT for a color, RGB, image is as follows:
1) Find the covariance matrix in RGB space, given by:
where
Similar equations are used for CGG and CBB (the auto-covariance terms) 10
20 20 10
(10 20 10 20) 15 4
1 + + + =
R = m
-5 5
5 -5
( 5 5 5 5) 0
4
1 − + − + =
RR = C
R
i m
R −
Red channel ⎥⎥⎥
⎦
⎤
⎢⎢
⎢
⎣
⎡
−
−
−
−
−
−
−
−
= 0
] [COV RGB
The elements of the covariance matrix that involve more than one of the RGB variables, CGR, CBR, CRG, CBG, CRB, and CGB, are called cross-covariance terms and are found as follows:
2. Find the eigenvalues of the covariance matrix, e1, e2 and e3, and their corresponding eigenvectors(고유벡터):
Order them such that e1 is the largest eigenvalue, and e3 is the smallest. (e1>e2>e3)
[ ]
[ ]
[
31 32 33]
3
23 22 21 2
13 12 11 1
E E E e
E E E e
E E E e
, ,
, ,
, ,
⇒
⇒
⇒
(e1>e2>e3)
3. Perform the linear transform on the RGB data by using the eigenvectors as follows:
The PCT data is P1, P2 and P3 where the P1 data is the principal component and contains the most variance (see Fig. 4.3.9)
correct the third equation on page 231
compression
In pattern recognition theory the measure of variance(변이치) is a measure of
information(정보치), in this sense most information is in the principal component band
Used in image compression, since this transform is optimal in the least-square-error(평균 제곱 오차) sense (most of the information, assumed to be directly correlated with variance, is in a reduced dimensionality)
It has been experimentally determined (application involving a database of medical images) that the dimension with the largest variance after the PCT was performed contained approximately 91% of the variance
This would allow at least a 3:1 compression and still retain 91% of the information
91% information of original image 1/3 volume of original image
PCT
P1 P2
P3
R
G B
목차
5.1 Introduction
5.2 Fourier Transform
5.2.1 The One-Dimensional Discrete Fourier Transform 5.2.2 The Two-Dimensional Discrete Fourier Transform 5.2.3 Fourier Transform Properties
5.2.4 Displaying the Fourier Spectrum 5.3 Cosine Transform
5.4 Walsh-Hadamard Transform 5.7 Filtering
5.7.1 Lowpass Filters 5.7.2 Highpass Filters
5.7.3 Bandpass and Bandreject Filters 5.6 Principal Components Transform
5.5 Haar Transform 5.8 Wavelet Transform
영상 피라미드
N N×
2 / 2
/ N
N ×
1×1 2 2× 4 4×
피라미드 영상구조
9 고해상도 영상을 표현
Î 개개의 물체 특징을 분석하는데 유용
9 저해상도 영상을 표현
Î 큰 구조 또는 전체적인 배경을 분석하는데 유용
키보드, 마우스 분석 (1024X1024)
모니터 분석 (512X512)
책상 분석 (265X265)
부 대역 부호화(Subband Coding)
frequency
gain Low band High band
5.5 Harr Transform
The Haar transform has rectangular waves as basis functions Basis vectors contain not just +1 and -1, but also contain zeros The Haar transform is derived from the Haar matrices
Basis vectors for a Haar transform of two basis vectors (N = 2), four basis vectors (N
= 4) and eight basis vectors (N = 8) are:
??
As the order increases the number of zeros in the basis vectors increase
This has the unique effect of allowing a multiresolution decomposition (다해상도 분 해) of an input image
The Haar transform retains both spatial and sequency information
a) Original image b) Haar transform image ( Log Remapped )
Note: Haar provides edge information at increasing levels of resolution
??
5.8 Wavelet Transform
The wavelet transform contains not just frequency information, but also spatial information
One of the most common models for a wavelet transform uses the Fourier transform and highpass and lowpass filters
The wavelet transform breaks an image down into four subsampled, or decimated, images by keeping every other pixel
4 7 10
The wavelet results consist of
One subsampled image that has been highpass filtered in both the horizontal and vertical directions
One that has been highpass filtered in the vertical and lowpassed in the horizontal One that has been highpassed in the horizontal and lowpassed in the vertical
One that has been lowpass filtered in both directions
1단계 Wavelet Transform 2단계 Wavelet Transform
LL HL
HH LH
Uses the convolution property of the Fourier transform to perform the wavelet transform in the spatial domain
주파수 영역에서의 곱 Î 공간 영역에서의 convolution
Uses the separable property to perform a 2-D wavelet with two 1-D filters
A special type of convolution called circular convolution must be used in order to perform the wavelet transform with convolution filters
Circular convolution is performed by taking the underlying image array and extending it in a periodic manner to match the symmetry implied by the discrete Fourier transform
Circular convolution allows us to retain the outer rows and columns
This is important since we may want to perform the wavelet transform on small blocks, and eliminating the outer row(s) and column(s) is not practical
Haar basis vectors
Many different convolution filters are available for use with the wavelet transform An example of Haar basis vectors are:
An example of Daubechies basis vectors are:
As these are separable, so they can be used to implement a wavelet transform by first convolving them with the rows and then the columns
The wavelet transform is performed by doing the following:
1. Convolve the lowpass filter with the rows (this is done by sliding, multiplying coincident terms and summing the results) and save the results
(Note: For the basis vectors as given, they do not need to be reversed for convolution) 2. Convolve the lowpass filter with the columns (of the results from step 1), and subsample this result by taking every other value; this gives us the lowpass-lowpass version of the image
3. Convolve the result from step 1, the lowpass filtered rows, with the highpass filter on the columns. Subsample by taking every other value to produce the lowpass-highpass image
4. Convolve the original image with the highpass filter on the rows, and save the result 5. Convolve the result from step 4 with the lowpass filter on the columns; subsample to yield the highpass-lowpass version of the image
6. To obtain the highpass-highpass version, convolve the columns of the result from step 4 with the highpass filter
Wavelet Transform
Wavelet Transform Display
Location of frequency bands in a four-band wavelet
transformed image. Designation is row/column.
LL HL
HH LH
Fourier, Walsh-Hadamard, Cosine Spectra
Contain No Obvious Spatial Information (공간 정보 없음)
a) Original image b) Fourier spectrum
c) Walsh-Hadamard spectrum d) Cosine spectrum
Fourier, Walsh-Hadamard, Cosine Spectra
Performed on Small Blocks Resembles Image(공간 정보 표현)
a) Original image b) Fourier spectrum 8x8 blocks
c) Fourier spectrum 4x4 blocks d) Walsh-Hadamard spectrum 8x8 blocks
256x256 image
8x8 subimage
Fourier, Walsh-Hadamard, Cosine Spectra
Performed on Small Blocks Resembles Image (공간 정보 표현)
e) Walsh-Hadamard spectrum, 4x4 blocks
f) Cosine spectrum, 8x8 blocks
g) Cosine spectrum, 4x4 blocks
Note: All spectra are log remapped
The inverse wavelet transform is performed in the following way:
Enlarging the wavelet transform data to its original size Inserting zeros between each value
Convolving the corresponding (lowpass and highpass) inverse filters to each of the four subimages
Summing the results to obtain the original image
∑
Enlarging inverse
For the Haar filter, the inverse wavelet filters are identical to the forward filters
For the Daubechies, the inverse wavelet filters are
Daubechies wavelet filters
Daubechies inverse wavelet filters
The wavelet transform is used in image compression, for example in JPEG2000 The multiresolution decomposition property of the wavelet transform, makes it useful in applications where it is desirable to have coarse information available fast such as perusing an image database or progressively transmitting images on the Internet
Reference
Umbaugh, Computer Imaging : Digital Image Analysis and Processing, CRC Press, 2005.
Gonzalez Woods, Digital Image Processing, Prentice Hall, 2002.
천인국, 이강승, 영상처리 기초편, 기한재, 2004.
정성환, 이문호, JAVA를 이용한 디지털 영상처리, 정익사, 2005.
이강웅, 백중환, Signal & System, 복두출판사, 2006.
이승훈, 윤동한, 알기쉬운 웨이블렛 변환, 진한도서, 2002.
Vinay K. Ingle, John G. Proakis, Digital Signal Processing Using MATHLAB, 시그마 프레스, 1998.