Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Motion & Geometry based methods

in Computer Vision
ECE 4078- MGCV
Concept of Frequency
• Frequency is measured in Hertz, cycles or periods per
second
– Higher frequency means more cycle per second
– Higher frequency means shorter period
– Zero frequency means infinite period, which means constant
signal
• Fourier transform of a function of time has units, cycles
per second
– FT of a function of pixels (eg an image) will have units cycles per
pixel
– Rapid changes in a signal corresponds to higher frequencies,
slow changes are represented by lower frequencies
– Rapid changes in the intensity in an image are high frequency
Concept of Frequency
• Slowest varying frequency corresponds to the average gray level of
an image
• Low frequency corresponds to the slowly varying component of an
image
– Located near the origin of FT of image, F (0,0)
– Eg: Smooth gray level variation of wall, floor, sky, etc.
• High frequency corresponds to faster and faster gray level changes
– Located farther away from origin
– Eg: Edges of objects, noise
Fourier Transform

• Fourier transform is linear

• Inverse Fourier Transform


– To recover the signal from its Fourier Transform

• Phase and magnitude:


– Consists of real and complex component
F(g(x,y)) (u,v) = FR(g) + i* FI(g)

– Difficult to draw complex function of the plane=> separately plot


magnitude (magnitude spectrum) and phase (phase spectrum)
X
Fourier Transform

• FT of a function at (u,v) depends on WHOLE function


– What is F(0,0)?
– Notice that the domain of integral is over whole domain of
function

• Hence,
– A local change in the function (e.g: set to zero a block of point) is
going to modify every point in Fourier domain
• Difficult to use as a representation : Cannot tell whether a pattern is
present just by looking at FT

• STFT and Wavelet transform


Lowpass Filter
• Ideal LPF: Passes without attenuation all frequencies within a circle
of radius from the origin, and “cuts off” all frequencies outside this
circle

• where D0 is a positive constant, and


• D(u,v) is the distance between a point (u,v) in the frequency domain
and the center of the P ×Q frequency rectangle
Lowpass Filter

(a) Original image of size 688 × 688 pixels. (b)–(c) Results of filtering using
ILPFs with cutoff frequencies set at radii values 10 and 30 respectively
Lowpass Filter
• Gaussian lowpass filter:
Highpass Filter
• Subtracting a LPF transfer function from 1 yields the
corresponding HPF filter transfer function

• Ideal HPF

• Gaussian HPF
Highpass Filter
Highpass Filter

• Image filtered by ideal HPF and Gaussian HPF

• (a) Smudged thumbprint. (b) Result of highpass filtering (a). (c) Result of
thresholding
Bandreject Filter

• Ideal and Gaussian bandreject filters


• If additive periodic noise can be approximated as 2D sin function
– Easy to locate the noise in the Fourier transform of the image
Bandreject Filter

• In above image, noise components lie on an approx. circle, Hence


use circularly symmetric bandreject filter
– To remove ONLY noise, make the width of filter smaller
– The above result CAN NOT be obtained using spatial filtering !!
Sampling and aliasing
• What information is lost when we convert continuous time signal to
digital?
– Fourier transform provide an insight

• Eg: gray circle represents the samples. Which is a good sampling?


Sampling
• Sampling:
– Passing from a continuous function to a collection of values on a
discrete grid
– Eg: Passing from irradiation at the back of a camera system to
the pixel value reported by camera.

• Sampling in one dimension


– Takes a 1D function and returns a vector whose elements are
values of that function at the sample point
• For our purpose, assume sample points to be integer
• ith component of f is f(xi)
Sampling
• Sampling in two dimension
– Similar to sampling in 1D
– Assume samples are drawn at points with integer coordinates=>
yield uniform rectangular grid (good model for most camera)
– Therefore, sampled images are rectangular arrays of finite size

– NOTE: Sampling can occur on nonregular grid (eg human retina)


Sampling
• Sampling in two dimension
– Formally, sample a 2D function, which gives an array

– ith, jth element of array

– Note: Samples are not always evenly spaced in


practical systems
• Eg: TV screen aspect ration is 4: 3 (width: height)
• Cameras accommodate this effect by spacing samples points
slightly farther apart horizontally than vertical=> no square
pixels
Aliasing
• Sampling result in loss of information
• Sampled signal = product of original signal with bed of
nails function (2D 𝛿 function)
– Using convolution theorem, FT of this product = product of
convolution of FT of these two function
– Recall: Convolving a function with a shifted 𝛿 function merely shift
the function

– => Hence, FT of sampled signal is sum of collection


of shifted version of the Fourier transform of signal

– FT(sample2D(f(x,y)) = σ∞ ∞
𝑖=−∞ σ𝑗=−∞ 𝐹(𝑢 − 𝑖, 𝑣 − 𝑗)
• Where FT(f(x,y)) = F(u,v)
Aliasing

• Suppose the shifted


version of FT(f(x,y))
does not intersect=>
can reconstruct the
signal from the sampled
version
Aliasing

• But if support regions


Do overlap =>can not
Reconstruct the signal
(as different copies of FT
will add in overlap region)

• A sampling rate equal


to twice the highest
frequency is called the
Nyquist rate.
• Sampling must exceed
the Nyquist rate.
Aliasing
• Here sampled version of an image : resampling by factors of two
(all scaled to same size)
– Note aliasing: high frequency alias down to low spatial freq
– Smallest image is an extremely poor representation of large image
Aliasing
• Magnitude of Fourier Transform
– F(0,0) at center
– Note: FT of resampled image is obtained by scaling the FT of original image and
then tiling the plane
– Interference between copies of original FT => cannot recover original signal
Aliasing

1/2 1/4 (2x zoom) 1/8 (4x zoom)

Source: S. Seitz/Noah Snavely


Smoothing and resampling
• How to reduce the content of the original FT outside the range |u|
<1/2, |v| <1/2?
• Use Gaussian
• Recall: FT of a Gaussian is a Gaussian and Gaussian die away fairly
quickly
• Thus, convolve the image with Gaussian or multiply the FT by Gaussian

G 1/8
G 1/4
Gaussian 1/2
Subsampling with Gaussian prefiltering

Gaussian 1/2 G 1/4 G 1/8

Source: S. Seitz/Noah Snavely


Compare with…..

1/2 1/4 (2x zoom) 1/8 (4x zoom)

Source: S. Seitz/Noah Snavely


• filter the image,
then subsample

F0 F1 F2

blur subsample blur subsample …


F0* H F1* H

Source: S. Seitz/Noah Snavely


Gaussian Pyramid
Low resolution

blur
G2  (G1 * gaussian)  2

G1  (G0 * gaussian)  2
blur

G0  Image
blur

High resolution

Source: S. Seitz/Noah Snavely


Gaussian Pyramid

Source: S. Seitz/Noah Snavely

You might also like