Professional Documents
Culture Documents
Linear Filters
One way you can do this is to slide the template over the image and
at each point you find the difference between the template and the
image in the overlapping region.
Wherever the difference is very small, we can say that we found the
template.
Minimize:
XX
E [i, j] = (f [m, n] − t [m − i, n − j])2 .
m n
Convolution:
XX
g [i, j] = f [m, n] t [i − m, j − n] = t ∗ f .
m n
Correlation:
XX
Rtf [i, j] = f [m, n] t [m − i, n − j] = t ⊗ f .
m n
No Flipping in Correlation
Figure: (1768-1830)
where,
A: Amplitude
T: Period
ϕ: Phase
u: Frequency(1/T )
February 23, 2023 32 / 121
Fourier Series
Fourier Transform:
Z∞
F (u) = f (x) e −i2πux dx
−∞
F (u) holds the amplitude and the phase of the sinusoid of frequency
u.
Z∞
F (u) = f (x) e −i2πux dx
−∞
q
Amplitude:A(u) = Re {F (u)}2 + Im {F (u)}2
Convolve the noisy signal with Gaussian kernel to reduce the noise.
Fourier Transform:
Z ∞ Z ∞
F (u, v ) = f (x, y ) e −i2π(ux+vy ) dxdy
−∞ −∞
Fourier Transform:
Z ∞ Z ∞
f (x, y ) = F (u, v ) e i2π(ux+vy ) dudv
−∞ −∞
where p = 0, 1, . . . , M − 1, q = 0, 1, . . . , N − 1.
p and q are frequencies along m and n, respectively.
for m = 0, 1, . . . , M − 1, n = 0, 1, . . . , N − 1.
With these expressions, we can now compute the Fourier transform of
discrete images.
February 23, 2023 48 / 121
2D Fourier Transform: Example 1
Given captured image g (x, y ) and the PSF h(x, y ) can we estimate
actual scene f (x, y )?
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v )
F ′ (u, v ) = → IFT → f ′ (x, y )
H (u, v )
G (u, v ) 1
F ′ (u, v ) =
H (u, v ) 1 + NSR(u,v2)
|H(u,v )|
where:
1 1
Weiner Filter W (u, v ) =
H (u, v ) 1 + NSR(u,v2)
|H(u,v )|
G (u, v ) 1
F ′ (u, v ) = .
H (u, v ) 1 + NSR(u,v2)
|H(u,v )|
|N(u, v )|2
NSR(u, v ) = .
|F (u, v )|2
NSR (u, v ) = λ.
At the image plane there are image sensor which converts this
continuous image into discrete digital image.
h (rk ) = nk for k = 0, 1, 2, . . . , L − 1,
h (rk ) nk
p (rk ) = =
MN MN
where M and N are the number of image rows and columns,
respectively.
Histogram are simple to compute and are also suitable for fast
hardware implementations, thus making Histogram-based techniques
a popular tool for real-time image processing.
s = T (r ) , 0 ≤ r ≤ L − 1
r = T −1 (s), 0 ≤ s ≤ L − 1
LHS Figure:
We see that it is possible for multiple input values to map to a single
output value and still satisfy these two conditions.
This function performs a one-to-one or many-to-one mapping. This is
perfectly fine when mapping from r to s.
However, if we wanted to recover the values of r uniquely from the
mapped values.
This would be possible for the inverse mapping of sk , but the inverse
mapping of sq is a range of values, which prevents us in general from
recovering the original value of r that resulted in sq .
RHS Figure:
T (r ) be strictly monotonic guarantees that the inverse mappings will
be single valued (i.e., the mapping is one-to-one in both directions).
z = G −1 (s) = G −1 [T (r )] (C)
Similarly, function G (z) can be obtained from Eq. (B) because pz (z)
is given.
Equations (A) through (C) imply that an image whose intensity levels
have a specified PDF can be obtained using the following procedure:
1 Obtain pr (r ) from the input image to use in Eq. (A).
2 Use the specified PDF, pz (z), in Eq. (B) to obtain the function G (z).
3 Compute the inverse transformation z = G −1 (s); this is a mapping
from s to z, the latter being the values that have the specified PDF.
4 Obtain the output image by first equalizing the input image using Eq.
(A); the pixel values in this image are the s values. For each pixel with
value s in the equalized image, perform the inverse mapping
z = G −1 (s) to obtain the corresponding pixel in the output image.
When all pixels have been processed with this transformation, the PDF
of the output image, pz (z), will be equal to the specified PDF.