Docsity

Hough Transform and Image Processing: Lecture Notes, Study notes of Computer Science

Partial preview of the text

Download Hough Transform and Image Processing: Lecture Notes and more Study notes Computer Science in PDF only on Docsity!

Lecture-

Hough Transform

Examples

Hough Space

Theta is from -90 to +

Fitting Lines In an Image

Fitting Lines In an Image

Fitting Circles

Detecting Lines in Gray Level

Images

Detect yellow line in the middle

Use gray levels instead of edges

Increment the parameter space by gray level at a pixel instead of by 1.

Pyramids

  • Very useful for representing images.
  • Pyramid is built by using multiple copies of

image.

  • Each level in the pyramid is 1/4 of the size

of previous level.

  • The lowest level is of the highest resolution.
  • The highest level is of the lowest resolution.

Pyramid

Gaussian Pyramids

[ ] , , - 1

= l n ln

g EXPAND g

2

2

2

2

, , 1

i p j q

g i j w p q g

p q

ln ln

= (^) Â Â

=- =-

Reduce (1D)

() ˆ( ) ( 2 )

2

2

1

g i w m g i m

m

l l

= + Â

=-

1 1 1

1 1

- -

l l l

l l l

w g w g w g

g w g w g w

1 1 1

1 1

- -

l l l

l l l

w g w g w g

g w g w g w

Reduce

Expand (1D)

2

2

, , 1

i p

g i w p g

p

ln ln

 =-

, 1 , 1 , 1

, , 1 , 1

- -

ln ln l n

ln ln ln

w g w g w g

g w g w g

gl , n ( 4 )= w ˆ(- 2 ) gl , n - 1 ( 1 )+ w ˆ( 0 ) gl , n - 1 ( 2 )+ w ˆ( 2 ) gl , n - 1 ( 3 )

Convolution Mask

[ w ( - 2 ), w (- 1 ), w ( 0 ), w ( 1 ), w ( 2 )]

Convolution Mask

  • Separable

w ( m , n ) = w ˆ( m ) w ˆ( n )

w ˆ^ ( i ) = w ˆ(- i )

[ c , b , a , b , c ]

•Symmetric

Convolution Mask

  • The sum of mask should be 1.

a + 2 b + 2 c = 1

a + 2 c = 2 b

•All nodes at a given level must contribute the

same total weight to the nodes at the next

higher level.

c c

b

b

a

Approximate Gaussian

0

0.

0.

0.

0.

0.

0.

0.

0.

c b a b c

Gaussian

Gaussian

2

2

( )

o

x

g x e

=

Gaussian

2

2

( )

o

x

g x e

=

x

g(x)

Gaussian Pyramid

Laplacian Pyramids

  • Similar to edge detected images.
  • Most pixels are zero.
  • Can be used for image compression.

[ ] 2 2 3 L = g - EXPAND g

[ ] 3 3 4 L = g - EXPAND g

[ ] 1 1 2 L = g - EXPAND g

Coding using Laplacian Pyramid

•Compute Gaussian pyramid

1 2 3 4

g , g , g , g

•Compute Laplacian pyramid

4 4

3 3 4

2 2 3

1 1 2

[ ]

[ ]

[ ]

L g

L g EXPANDg

L g EXPANDg

L g EXPANDg

=

= -

= -

= -

•Code Laplacian pyramid

Image Compression (Entropy)

.

Huffman Coding (Example-1)

A 1

A 2

A 3

A 4

P=.

P=.

P=.

P=.

0

1

0

1

0

(^1) A 1

A 2 10
A 3 110
A

4

Huffman Coding

()log ( )

255

0

H pi 2 pi

i

Â

. 125 log. 125 1. 75

. 5 log. 5. 25 log. 25. 125 log. 125

H =- - - -

Entropy

Image Compression

1

.