image representation - university of haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · image pyramids...

35
Image Processing – lesson 8 Quad Trees Gaussian pyramids Laplacian Pyramids Wavelet Pyramids Applications Image Representation

Upload: others

Post on 31-May-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Processing – lesson 8

Quad Trees

Gaussian pyramids

Laplacian Pyramids

Wavelet Pyramids

Applications

Image Representation

Page 2: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Quad Trees

Quad tree image representation = a tree representationwhich represents recursive subdivisions of an image.

Quad tree representation of an imageExample:

Page 3: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Quad Tree representation

Image

1 2

3 41 2 3 4

Page 4: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Quad Tree Applications:

• Compression

• Segmentation (Split & Merge)

• Smoothing

• Binary Image Operations (“And” “Or” “Not”)

Page 5: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Quad Tree Representation - Example

Page 6: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Quad Tree Representation - Example

Page 7: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Quad Tree Representation

Original

Thresh = 0.20

Thresh = 0.40

Thresh = 0.55

Page 8: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

“Not”

“And”

“And”

Binary Operations Using Quad Trees

“And”

= 1 = 0

Page 9: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramids

Image features at different scales require filters at different scales.

f(x)

f (x)

Edges (derivatives):

Objects (correlation):

Page 10: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramids

Image Pyramid = Hierarchical representation of an image

Image Pyramid = A collection of images at different resolutions.

Low Resolution

High Resolution

Details in image -low+high frequencies

No details in image -(blurred image)low frequencies

Page 11: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramid

High resolution

Low resolution

Page 12: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramid Frequency Domain

High resolution

Low resolution

Page 13: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

*

= =

Image Blurring = low pass filtering

Page 14: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

*

*

*

=

=

=

Page 15: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramid

High resolution

Low resolution

Page 16: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Level 02n X 2n

Level 12n-1 X 2n-1

Level M1 X 1

Gaussian Pyramid

w2 w3w1w0 w4

w2 w3w1w0 w4

Page 17: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

a bbc c

a bbc c

Gaussian Pyramid

Burt & Adelson (1981)

Normalized: Σwi = 1

Symmetry: wi = w-i

Unimodal: wi ≥ wj for 0 < i < j

Equal Contribution: for all j Σwj+2i = constant

a + 2b + 2c = 1a + 2c = 2b

a > 0.25b = 0.25c = 0.25 - a/2

Page 18: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

For a = 0.4 most similar to a Gauusian filter

g = [0.05 0.25 0.4 0.25 0.05]

low_pass_filter = g * g' =

0.0025 0.0125 0.0200 0.0125 0.00250.0125 0.0625 0.1000 0.0625 0.01250.0200 0.1000 0.1600 0.1000 0.02000.0125 0.0625 0.1000 0.0625 0.01250.0025 0.0125 0.0200 0.0125 0.0025

12

34

5

1

2

3

4

50

0.05

0.1

0.15

0.2

Page 19: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

search

search

search

search

Hierarchical Pattern Matching

Page 20: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

image pattern correlation

Pattern matching using Pyramids - Example

Page 21: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Gaussian Pyramid -Computational Aspects

Memory:

2NX2N (1 + 1/4 + 1/16 + ... ) = 2NX2N * 4/3

Computation:

Level i can be computed with a single convolutionwith filter: hi = g * g * g * .....

i times

g g

h2 = * =

Example:

Page 22: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Laplacian Pyramid

Compression -compression rates are higher for predictable values.e.g. values around 0.

G0, G1, .... = the levels of a Gaussian Pyramid.

Predict level Gl from level Gl+1 by Expanding Gl+1 to obtain G’l

Gl

Gl+1

Reduce

G’l

Expand

Denote by Ll the error in prediction:

Ll = Gl - G’l

L0, L1, .... = the levels of a Laplacian Pyramid.

Page 23: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

expand

-

expand

expand

-

- =

=

=

Gaussian Pyramid

LaplacianPyramid

Laplacian Pyramid

Page 24: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Laplacian Pyramid - Example

Page 25: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Laplacian Pyramid -No scaling

Page 26: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Gaussian Pyramid

LaplacianPyramid

Fourier Fourier

Page 27: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

LaplacianPyramid

+

+

+ =

=

=

Reconstruction of the original image from the Laplacian Pyramid

expand

expand

= Original Image

expand

Page 28: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Laplacian Pyramid -Computational Aspects

Memory:

2NX2N (1 + 1/4 + 1/16 + ... ) = 2NX2N * 4/3

Computation:

However coefficients are highly compressable.

Li can be computed from G0 with a single convolutionwith filter: ki = hi-1 - hi

hi-1 hi

- =

ki

k1 k2 k3

Page 29: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Multiresolution Spline

High Frequencies

Middle Frequencies

Low Frequencies

When splining two images, transition from one image tothe other should behave:

Page 30: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Fourier Space

Wavelet Decomposition

Page 31: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Wavelet Transform - Example

Page 32: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Wavelet Transform - Example

Page 33: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Wavelet Transform - Example

Page 34: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramids - Comparison

Fourier Not localized in spaceLocalized in Frequency

GaussianPyramid

Localized in spaceNot localized in Frequency

Wavelet Pyramid

Localized in spaceLocalized in Frequency

Transform Basis Characteristics

Gaussian Filters

Sines+Cosines

LaplacianPyramid

Laplacian Filters

Localized in spaceNot localized in Frequency

Wavelet Filters

Frequency

Page 35: Image Representation - University of Haifacs.haifa.ac.il/~dkeren/ip/lecture8.pdf · Image Pyramids Image Pyramid = Hierarchical representation of an image Image Pyramid = A collection

Image Pyramids - Comparison

Image pyramid levels = Filter then sample.

Filters:

Gaussian Pyramid

Laplacian Pyramid

Wavelet Pyramid