0% found this document useful (0 votes)
27 views69 pages

MODULE I Image Transforms 1

The document discusses various image transforms including 1D and 2D Fourier transforms. It covers topics like complex numbers, even and odd functions, and properties of the 2D Fourier transform such as linearity, scaling, separability, and differentiation. The document provides mathematical definitions and examples to explain these concepts.

Uploaded by

jacksonb200743cs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views69 pages

MODULE I Image Transforms 1

The document discusses various image transforms including 1D and 2D Fourier transforms. It covers topics like complex numbers, even and odd functions, and properties of the 2D Fourier transform such as linearity, scaling, separability, and differentiation. The document provides mathematical definitions and examples to explain these concepts.

Uploaded by

jacksonb200743cs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Image Transforms

CS4043D Image Processing

Anu Maria Sebastian


CSE, NIT Calicut

Date: 19/2/2024
Outline
00 Background

01 1D Fourier Transform

02 2D Fourier Transform

03 Properties of 2D Fourier

Transform

04 Hadamard Transform

05 Walsch Transform
Signals in Image
Signals in Image
Signals in Image

This wave can be created with a


combination of different
sinusoidal waves.
Sinusoids
Sinusoids

1 cycle
Sinusoids

2𝜋 duration
Sinusoids

Here value of
𝜔 𝑖𝑠 1, A is 1, 𝜑 𝑖𝑠 0
Sinusoids

Here value of
𝜔 𝑖𝑠 1, A is 1, 𝜑 𝑖𝑠 0

Eg: For 𝜑 = 0.3 ,


the wave gets trimmed at the beginning
Any Signal as Sum of Sinusoids
Fourier Transform
Signal in Spatial domain Corresponding signal in frequency domain

Ordinate represents magnitude of each


Mean amplitude is zero

wave frequency
There is a DC component wave with
0 frequency and high amplitude for a
signal that has mean amplitude as
non- zero.
Image vs Sinusoid
Image vs Fourier Transform
High Frequency and Low Frequency

If the intensity of the image If the image has relatively


drastically changes (contrast uniform level of intensity
edges) it is a high frequency (gradient) it is low frequency
01
1D Fourier Transform
Introduction
• Fourier Series: Any periodic function can be represented as a
sum of sine and/or cosine of different frequencies multiplied
by a different coefficient.

• Fourier Transform: Any function (periodic/non-periodic) can


be represented as an integral of sine and/or cosine of different
frequencies multiplied by a weighting function.

• Recovery property: The transformation can be completely


recovered without losing any information using an inverse
operation.
Complex Numbers
• Real numbers are a subset of complex numbers.
C=r+ig, i= −1, in signal processing field j is often used in place of i.

• Complex Conjugate: (replacing i with –i)


C=r-ig Ccosθ (r,g)

Imaginary axis

Csinθ
• In vector representation:
θ
real axis

r=Ccosθ
g=Csinθ
|C|= 𝒓2 + 𝒈2 =>C= |C|(cosθ+ isinθ)
Complex plane
Complex Numbers
• Using Euler’s formula

𝒆iθ = cosθ+ isinθ

Imaginary axis
Ccosθ (r,g)

Csinθ
θ
real axis
Complex Numbers
• Using Euler’s formula

𝒆iθ = cosθ+ isinθ

Imaginary axis
• In vector representation: Ccosθ (r,g)

Csinθ
→ C= |C|(cosθ+ isinθ)
θ
real axis

replace
→ C= |C| 𝒆iθ

Θ=tan-1 (g/r), e=2.718


Even and Odd functions
Even and Odd functions
Complex Numbers
→C= |C|(cosθ+ isinθ)

• Even functions are symmetric with respect to y-axis.


• All cosine functions are even functions.

• Odd functions are symmetric with respect to origin.


• All sine functions are odd functions.
Complex Numbers
• Example of a complex representation to polar representation:

Given C1= 1+i2.


|C1|= 𝒓2 + 𝒈2 = √3 ,θ=tan-1 (g/r)

Equivalent polar representation is


√3 𝒆iθ , θ=63.4°
As a Function of Frequency
• Rewriting it as a function of variable u:

F(u)= R(u)+iG(u), Conjugate is R(u)-iG(u)

R(u)→ Magnitude/Amplitude of the signal


G(u)→ Phase of the signal

R(u)=A(u) cos(𝜙 𝒖 ), A(u)→ Amplitude of the frequency component=|F|


G(u)= A(u)sin(𝜙 𝒖 ), 𝜙 𝒖 → Phase of the frequency component=tan-1 (G(u)/ R(u))
FT Decomposing Signal into Component Waves and
Projecting in Frequency Domain
1D Fourier Transform
• FT =>

F(ω)= ‫׬‬−∞ 𝑓(𝒙)𝒆−𝑖𝝎𝒙 𝑑𝒙 , 𝝎→ angular frequency (in radians/sec)

F(𝒖)= ‫׬‬−∞ 𝑓(𝒙)𝒆−𝑖𝟐𝜋𝒖𝒙 𝑑𝒙, 𝒖→ frequency (in hertz)

Using Euler’s formula we can rewrite it as :



F(𝒖)= ‫׬‬−∞ 𝑓 𝒙 [𝒄𝒐𝒔 2𝜋𝒖𝒙 − 𝑖𝒔𝒊𝒏 2𝜋𝒖𝒙 ]𝑑𝒙

• FT-1 =>

𝑓(𝒙) = ‫׬‬−∞ 𝐹(ω)𝒆𝑖𝝎𝒙 𝑑ω

𝑓(𝒙) = ‫׬‬−∞ 𝐹(𝒖)𝒆2𝑖𝜋𝒖𝒙 𝑑𝒖
1D Fourier Transform

@Michaelmas 2014
02
2D Fourier Transform
2D Fourier Transform
• FT =>
∞ ∞
F(u,v)= ‫׬‬−∞ ‫׬‬−∞ 𝑓(𝒙, 𝒚) 𝒆−𝑖𝟐𝜋(𝒖𝒙+𝒗𝒚) 𝑑𝒙 𝑑𝒚

• FT-1 =>
∞ ∞
𝑓(𝒙, 𝒚)= ‫׬‬−∞ ‫׬‬−∞ 𝑭(u,v) 𝒆𝑖𝟐𝜋(𝒖𝒙+𝒗𝒚) 𝑑𝒖 𝑑𝒗
2D Fourier Transform
f(x,y)= f(x,y) F(u,v)

@Michaelmas 2014

Spectrum
Components in 2D Transform
03
Properties of 2D Fourier
Transform
Properties of 2D Fourier Transform
• Linearity
• Scaling
• Separability
• Differentiation
• Convolution
• Shift Operation
• Conjugate Symmetry

∞ ∞
FT ⇒ F(u,v)= ‫׬‬−∞ ‫׬‬−∞ 𝑓(𝒙, 𝒚) 𝒆−𝑖𝟐𝜋(𝒖𝒙+𝒗𝒚) 𝑑𝒙 𝑑𝒚
Linearity
❑ It is an essential characteristic that simplifies the analysis and
processing of signals and images.

For two functions f1(x,y) and f2(x,y), and we have two constants a
and b,

FT(a f1(x,y)+ b f2(x,y))= a FT(f1(x,y))+ b FT(f2(x,y))

• If a and b are 1, it expresses the distributive property of FT.


Linearity
f1(x,y) f2(x,y)

5x 7x
+

Let s(x,y)=5. f1(x,y)+7. f2(x,y)

S(u,v)=FT(s(x,y))
Linearity
f1(x,y) F1(u,v) 5xF1(u,v)

f2(x,y) F2(u,v) +

5xF1(u,v)+ 7xF2(u,v)

7xF2(u,v)
Linearity

R.H.S=>
FT(f1(x,y))=
FT(f2(x,y))=

F1(u,v)=

F2(u,v)=

=
Linearity

R.H.S=>

5.FT(f1(x,y))=> 5. =
7.FT(f2(x,y))=> 7. =

=> +
Linearity

L.H.S=>
Let s(x,y)=5. f1(x,y)+7. f2(x,y)
FT(s(x,y))= 5. + 7.
Linearity

L.H.S=>
Let s(x,y)=5. f1(x,y)+7. f2(x,y)
FT(s(x,y))= 5. + 7.

S(u,v)= +14.

= +

L.H.S=R.H.S
Scaling
❑ It refers to how changes in the spatial domain affect the
frequency domain, and vice versa.

For two functions f1(x,y) and f2(x,y)

1 𝑢 𝑣
FT(f1(a𝑥, b𝑦))= (F( , ))
𝑎 |𝑏| 𝑎 𝑏

• The absolute values are taken to ensure that scaling factors


are positive.
Scaling

Sample of scaling effect in single variable


function f(x)
Separability
❑ The separability property of the 2D Fourier transform refers
to the ability to decompose a 2D function into two 1D
functions.

If f(x,y) is separable, then F(u,v) is also separable.

⇒ if f(x,y)=f1(x)f2(y) then,

F(u,v) can be rewritten as F(u,v) = F1 (u)F2(v)

⇒ 𝐹𝑇(f1 (x)) 𝐹𝑇(f2 (y) )


Separability

Let f(x,y) be
If f(xy) is separable

Then, FT is also separable


Separability
Apply the integral solution for

Here,

G(u)=
H(v)=

• F(u,v)=G(u).H(v)= .
Separability
Next let us take

then,

❑ These functions are not separable.


❑ Only if f(x,y) is separable, the 2D functions of the image can be split
into two 1D functions to compute FT along x-dimension, and y-
dimension separately. In that case, FT(g(x))=G(u), and FT(h(y))=H(v).
❑ Finally we can combine the result to get the FT of 2D image as the
product of its individual Fourier transforms. i.e; F(u,v)=G(u).H(v).
Separability FT along X-axis

Original image
Separability
FT along Y-axis

Original image
Separability

F(u) F(v)
F(u,v)
Separability

Directly computing FT
of 2D image

Original image F(u,v)


Differentiation
For a function f(x,y) the partial derivative can be computed as


• FT( 𝑓(𝑥, 𝑦))=i 𝑥 F(u,v)
ⅆ𝑥

• FT( 𝑓(𝑥, 𝑦))=i y F(u,v)
ⅆ𝑦

❑ The presence of i in the formulas indicates a phase shift of 90


degrees.
❑ It signifies the relationship between the spatial and frequency
domains.
❑ This is useful in operations that involve gradients and edge
detection.
Convolution
❑ Convolution of two functions in the spatial domain is equal to
the pointwise product of their individual Fourier transforms.

If f(x,y) and h(x,y) be two functions in spatial domain, then

⇒ f x, y ∗ h x, y = F(u,v) H(u,v)
Convolution
Shift Operation
❑ It indicates how a shift in the function of spatial domain
corresponds to a phase shift in the frequency domain.

⇒ FT(f(𝒙 -x0, 𝒚 -y0)) =e-i2𝜋 (𝑢𝑥


0
. F(u,v)
+𝑣𝑦0 )

❑ Useful in image registration, where objects of different images


are transformed to map points of an object in another image
to perform comparison or fusion.
❑ The transformations may include rotation, translation,
deformation etc.
Conjugate Symmetry
❑ For a real valued function f(x,y) and FT(f(x,y))

⇒ F(u,v)=F(-u,-v)
Example:

Should be equal

❑ Not a universal property.


❑ It is useful to identify redundant data in storing Fourier
transform.
Application of Properties
Let

FT(f(x,y)=

Given, F(u,v) = +

Now, let us shift our spatial co-ordinates to the left by a value 10.

Compute the FT of the new image. i.e. FT(f(𝒙 -x0, 𝒚 -y0))


Application of Properties
By Shift operation property this can be easily solved, we have

FT(f(𝒙 -x0, 𝒚 -y0)) =e-i2𝜋 (𝑢𝑥 0


. F(u,v)
+𝑣𝑦0 )

Here, x0=10, y0=0

Therefore,

FT(f(𝒙 -x0, 𝒚 )) =e-i2𝜋 (𝑢𝑥


0 +𝑣𝑦0 ) . F(u,v)

= e-i20𝜋𝑢 .[ + ]
04
HadamardTransform
Hadamard Transform
❑ The Hadamard transform is used for transforming signals with
sharp transitions or sparse characteristics.

❑ The Hadamard transformation decomposes a signal with a


set of basis functions into discrete sequences rather than a
sinusoidal wave.

❑ These basis functions are essentially the rows of the


Hadamard matrix with values [1, -1].

❑ Resulting transformed signal is a sequence of coefficients.


Hadamard Transform
❑ The input/signal length should be of size 2n , otherwise we can
pad it with zeroes.

❑ Hadamard transformation is reversible.

❑ It has the property that the resulting transformed


coefficients are often more sparse or concentrated.

❑ Applications are in image compression, encoded images for


transmission, denoising, and feature extraction.
Hadamard Transform
❑ A square Hadamard matrix of order 2n (for n>=0) is used
as kernel to transform an image into H-transform.

❑ Basic kernel is H0=[1].

❑ For larger values of n, Hn is computed as:

A scaling factor might be applied on the result in cases where we need to ensure
the transformation is orthogonal( often 1/C for 1D and 1/C2 for 2D).
Hadamard Transform
❑ Hn matrix is orthogonal,
HT. H = H. HT=I

❑ Hn matrix is involutory, (such matrices are often used in


transformations) when these are applied twice to
another matrix A , it returns to its original state of A.
H . H =H2= I
H.A=A”
H.A”=H.(H.A)=(H.H)A=IA=A
❑ Hn = HnT = Hn-1
Hadamard Transform
❑ 1D H-transform:
1
→ [Hcxcx 𝑥cx1]=ycx1
𝑐

x=[x0,x1,x2,….xc-1]

c, the dimension of kernel and the input should be


same.

❑ Inverse:
→ 𝑥cx1=Hcxc-1x y cx1
=Hcxcxycx1
Hadamard Transform
❑ 2D H-transform
1
→ [H x𝑋 xH T]
𝑐 2 cxc 𝑐𝑥𝑐 cxc
→ Hcxc is a symmetric matrix, hence its transpose will be

the same.
→ Here, ycxc =Hcxcx𝑋𝑐𝑥𝑐xHcxc

❑ Inverse transform:
→ 𝑋cxc=Hcxcx ycxc xHcxc
05
WalshTransform
Walsh Transform
❑ It is a special case of Hadamard kernel.

❑ Hadamard matrix uses natural ordering, whereas the derived


Walsh matrix uses sequencing ordering.

❑ It also decomposes a function into a linear combination of


rectangular basis functions, called Walsh functions with
values [− 1 ,1].
Walsh Transform
❑ Initially, we take the Hadamard matrix of required order.

❑ Then from right to left we count the number of sign-changes


between a pair of elements in each row.

❑ Then we will reorder the rows in the matrix, in such a way that
the successive row has higher number of sign-change count.

H4=
Thank You

You might also like