25
Lecture 7 Lecture 7 Generalized Hough Transfor m Texture Segmentation

Lecture 7

  • Upload
    krikor

  • View
    24

  • Download
    0

Embed Size (px)

DESCRIPTION

Lecture 7. Generalized Hough Transform Texture Segmentation. Generalized Hough Transform. Any fixed shape 2 parts: 1. Learn shape properties 2. Search for shape (target) in image. Learn Shape - “measurements”. 1) Choose an arbitrary “center” point - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture 7

Lecture 7Lecture 7

Generalized Hough Transform

Texture Segmentation

Page 2: Lecture 7

2

Generalized Hough Transform Generalized Hough Transform

Any fixed shape

2 parts: 1. Learn shape properties2. Search for shape (target) in image

Page 3: Lecture 7

3

Learn Shape - “measurements”Learn Shape - “measurements”

1) Choose an arbitrary “center” point

2) At some edge points, draw line to center

a - angle with x-axis

r - distance to center

q - gradient from edge detector

r1

2

3

4

56

7

1

(xc, yc)

Page 4: Lecture 7

4

GHT: R-tableGHT: R-table

r1, 1 r2, 2 r3, 3 r4, 4 r5, 5

0...19 15, 180 15, 179 16, 177 13,176 14,175

20...39 17, 160 14, 159 18, 161 15, 162 14, 163

30…49 19, 165 20, 170 22, 167 18, 159 21, 161

… … … … … …

340...359

23, 105 24, 103 21,102 22, 104 20, 103

From a relationship between r)

Page 5: Lecture 7

5

Search for ShapesSearch for Shapes

For each edge element

1. Use to find all ,ri) for that

2. For each ,ri)

xc = x + r cos (

yc = y + r sin (

3. Look for Max (xc,yc)

the object is there

Page 6: Lecture 7

6

Search For ShapeSearch For Shape

r

(xc, yc)

(x, y)

xc - x

yc - y

r

yy)180sin(sin c

xc – x = r cos (andyc – y = r sin (

-180

Page 7: Lecture 7

7

Search for ShapeSearch for Shape

1. Array A[xcmin..xcmax, ycmin…ycmax] initialized to 0

2. For each edge point with gradient (x,y)

find each (,r) from R-Table

xc = x + r cos (

yc = y + r sin (

A[xc,yc]++;

3. Look for peaks in A

each peak means object is there

Page 8: Lecture 7

8

Case when target is scaled/rotatedCase when target is scaled/rotated

Create A of 4-dimension A[xc, yc, S, ]

Scale factor Srotation factor

0..359

0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.1,1.2,1.3,1.4,1.5

xc = x + r cos (yc = y + r sin (

xc = x + r S cos (yc = y + r S sin (

Page 9: Lecture 7

9

Case when target is scaled/rotatedCase when target is scaled/rotated

For each (,r) from R-Table

*For each S = .3 to 1.5 step .1

*For each = 0 to 359 step 1

xc = x + r S cos (

yc = y + r s sin (

A[xc,yc,A,]++;

Look for peaks in 4-D Array

Impractical!!

Page 10: Lecture 7

10

Modified Genearlized Hough TransformModified Genearlized Hough Transform

Reduced 4D to 2DAllow Scale & Rotation

Page 11: Lecture 7

11

Modified Genearlized Hough TransformModified Genearlized Hough Transform

Gradient Direction is perpendicular to edge direction

2

r

L,

xc,yc

= 0

r1, 1, 1, L1 r2, 2, 2, L2 r3, 3, 3, L3 r4, 4, 4, L4

0...19 15,180,195,99 9,179,219,101 8,177,216,102 9,176,198,100

20...39 17,160,23,5 14,159,38,7 18,161,175,62 15,162,195,95

30…49 19,165,31,53 20,170,8,52 22,167,15,52 18,159,158,12

… … … … …

340..359 23,105,346,11 24,103,165,11 21,102,346,18 22,104,195,24

r, L,

Page 12: Lecture 7

12

MGHT: Rotation/Scale InvariantMGHT: Rotation/Scale Invariant

Smaller Object

is constantbring out , r, L, qLT - L of target

Scale factor = LT/L = S

Rotation factor -

xc = x + r S cos (yc = y + r s sin (

Rotated Object

Page 13: Lecture 7

13

Template

Target Image

Target edge

(f) Iteration 25, Energy=8.5315

(g) Iteration 26, Energy=7.0977

(h) Iteration 29, Energy=2.6243

(i) Result at Iteration 50, Energy=1.3657

Page 14: Lecture 7

14

(a) Template

(b) Transformed template

(c) Target Image

(d) Target edge Map

(g) Iteration 25, Energy = 8.269747

(h) Iteration 27, Energy = 4.643370

(i) Iteration 35, Energy = 1.257369

(j) Final result at iteration 40, Energy = 1.159310

Page 15: Lecture 7

15

(a) Template

(b) Target Edge

(c) Hough Space

(d) 1st match, Energy=1.799267, rejected

(e)2nd match 1.114566, accepted

(f) 1st vote, Energy=5.074061, rejected

Page 16: Lecture 7

16

(a)

(b) Target edge

(c) Hough space

Page 17: Lecture 7

17

Image QueryingImage Querying

Database Search for Circle shape Search for bulb shape

Page 18: Lecture 7

18

SegmentationSegmentation

Group pixels that belong to same region

with 4-connected color

Page 19: Lecture 7

19

Texture Segmentation Texture Segmentation

Segment images into texture regions

Page 20: Lecture 7

20

Texture Segmentation Texture Segmentation

Texture : - Statistical distribution of gray scale - Change in distribution change in texture

Spatial Gray Level Distributed Matrix (SGLD) - Co-occurrence Matrix Given a direction, it gives probability distribution of gray scale in that direction

Page 21: Lecture 7

21

Texture Segmentation Texture Segmentation

d = (1,1)

1 0 1 0 1 0

0 1 0 1 0 1

1 0 1 0 1 0

1 1 1 1 1 1

1 1 1 1 1 1

0 10 6 01 6 15

00( , )

01( , )

10( , ) 11( , )

P(0,0) = 6/27; P(0,1) = 0P(1,0) = 6/27; P(1,1) = 15/27

Total=27

Page 22: Lecture 7

22

Texture Segmentation Texture Segmentation

2 1 2 0 1

0 2 1 1 2

0 1 2 2 0

1 2 2 0 1

2 0 1 0 1

0 1 20 0 2 21 2 1 22 2 3 2

j

1x6

5 x 5 image with three gray levels

ii.

j

Gray-level co-occurrencematrix for d = (1,1)

Page 23: Lecture 7

23

Texture Segmentation Texture Segmentation

1 0 1 0 1 0 1 0

0 1 0 1 0 1 0 1

1 0 1 0 1 0 1 0

0 1 0 1 0 1 0 1

1 0 1 0 1 0 1 0

0 1 0 1 0 1 0 1

1 0 1 0 1 0 1 0

0 1 0 1 0 1 0 1

0 10 25 01 0 24

j

149x ( / )

8 x 8 checkerboardimage

i

i.

j

Gray-level co-occurrencematrix for d = (1,1)

0 10 0 281 28 0

j

156x ( / )i

i. j.

Gray-level co-occurrencematrix for d = (1,0)

Page 24: Lecture 7

24

Use of Texture Use of Texture

1) Segmentation2) Search

Split and Merge0 1

01

Page 25: Lecture 7

25

Food Inspection: TextureFood Inspection: Texture

หา Co-occurrence matrixที่�� d[3,3] และ d[-3,3]

กรองเฉล��ย

LoG