Today Image segmentation methods: Boundaries, Hough transform, - - PowerPoint PPT Presentation

today
SMART_READER_LITE
LIVE PREVIEW

Today Image segmentation methods: Boundaries, Hough transform, - - PowerPoint PPT Presentation

Today Image segmentation methods: Boundaries, Hough transform, Intelligent Scissors Slides based on Steve Seitz, Kristen Grauman, and others Boundaries in Medical Imaging Machine Edge Detection Image Human Boundary Marking Boundaries in


slide-1
SLIDE 1

Today

Image segmentation methods: Boundaries, Hough transform, Intelligent Scissors

Slides based on Steve Seitz, Kristen Grauman, and others

slide-2
SLIDE 2

Boundaries in Medical Imaging

Image Machine Edge Detection Human Boundary Marking

slide-3
SLIDE 3

Boundaries in Medical Imaging

Detection of cancerous regions.

[Foran, Comaniciu, Meer, Goodell, 00]

slide-4
SLIDE 4

Boundaries in Medical Imaging

Hard to detect in the presence of large amount of speckle noise

slide-5
SLIDE 5

Preprocessing Edge Images

Image Edge detection and Thresholding Noisy edge image Incomplete boundaries Shrink and Expand Thinning

slide-6
SLIDE 6

Given: Approximate Location of Boundary Task: Find Accurate Location of Boundary

  • Search for STRONG EDGES along normals to approximate boundary.
  • Fit curve (eg., polynomials) to strong edges.

Edge Tracking Methods

Adjusting a priori Boundaries:

slide-7
SLIDE 7

Fitting Lines to Edges (Least Squares)

c mx y + = c mx y

i i

− − ) , (

i i y

x y x

Given: Many pairs Find: Parameters Minimize: Average square distance: Using: Note:

) , (

i i y

x ) , ( c m

− − =

i i i

N c mx y E

2

) ( & = ∂ ∂ = ∂ ∂ c E m E x m y c − =

∑ ∑

− − − =

i i i i i

x x y y x x m

2

) ( ) )( (

N y y

i i

= N x x

i i

=

slide-8
SLIDE 8

Problem with Parameterization

y x

Line that minimizes E!!

slide-9
SLIDE 9

Curve Fitting

y x

Find Polynomial: that best fits the given points Minimize: Using: Note: is LINEAR in the parameters (a, b, c, d)

) , (

i i y

x d cx bx ax x f y + + + = =

2 3

) (

+ + + −

i i i i i

d cx bx ax y N

2 2 3

)] ( [ 1

, , , = ∂ ∂ = ∂ ∂ = ∂ ∂ = ∂ ∂ d E c E b E a E

) (x f

slide-10
SLIDE 10

Line Grouping Problem

Slide credit: David Jacobs

slide-11
SLIDE 11

This is difficult because of:

  • Extraneous data: clutter or multiple models

– We do not know what is part of the model? – Can we pull out models with a few parts from much larger amounts of background clutter?

  • Missing data: only some parts of model are

present

  • Noise
  • Cost:

– It is not feasible to check all combinations of features by fitting a model to each possible subset

slide-12
SLIDE 12

Hough Transform

Elegant (somewhat slow? method for direct object recognition

  • Edges need not be connected
  • Complete object need not be visible
  • Key Idea: Edges VOTE for the possible model
slide-13
SLIDE 13

Image and Parameter Spaces

c mx y + = ) , (

i i y

x y x

Equation of Line: Find: Consider point:

c mx y + = ) , ( c m ) , (

i i y

x

i i i i

y m x c

  • r

c mx y + − = + = m c ) , ( c m

Image Space Parameter Space Parameter space also called Hough Space

slide-14
SLIDE 14

Connection between image (x,y) and Hough (m,b) spaces – A line in the image corresponds to a point in Hough space – To go from image space to Hough space:

  • given a set of points (x,y), find all (m,b) such that y =

mx + b

x y m b m0 b0

image space Hough (parameter) space

Slide credit: Steve Seitz

Image and Parameter Spaces

slide-15
SLIDE 15

Connection between image (x,y) and Hough (m,b) spaces – A line in image corresponds to a point in Hough space – To go from image space to Hough space:

  • given points (x,y), find all (m,b) such that y = mx + b

– What does a point (x0, y0) in the image space map to?

x y m b

image space Hough (parameter) space

– Answer: the solutions of b = -x0m + y0 – this is a line in Hough space x0 y0

Slide credit: Steve Seitz

Image and Parameter Spaces

slide-16
SLIDE 16

What are the line parameters for the line that contains both (x0, y0) and (x1, y1)? – It is the intersection of the lines b = –x0m + y0 and b = –x1m + y1

x y m b

image space Hough (parameter) space

x0 y0

b = –x1m + y1 (x0, y0) (x1, y1)

Image and Parameter Spaces

slide-17
SLIDE 17

How can we use this to find the most likely parameters (m,b) for the most prominent line in the image space?

  • Let each edge point in image space vote for a set of

possible parameters in Hough space

  • Accumulate votes in discrete set of bins; parameters with

the most votes indicate line in image space.

x y m b

image space Hough (parameter) space

Image and Parameter Spaces

slide-18
SLIDE 18

Line Detection by Hough Transform

y x ) , ( c m

Parameter Space

1 1 1 1 1 1 2 1 1 1 1 1 1

) , ( c m A

Algorithm:

  • Quantize Parameter Space
  • Create Accumulator Array
  • Set
  • For each image edge increment:
  • If lies on the line:
  • Find local maxima in

) , ( c m ) , ( c m A c m c m A , ) , ( ∀ = ) , (

i i y

x 1 ) , ( ) , ( + = c m A c m A ) , ( c m ) , ( c m A

i i

y m x c + − =

slide-19
SLIDE 19

: perpendicular distance from line to origin : angle the perpendicular makes with the x-axis

Point in image space  sinusoid segment in Hough space

d y x = − θ θ sin cos

d

θ

[0,0]

d θ

x

y

Issues with usual (m,b) parameter space: can take on infinite values, undefined for vertical lines.

Image columns Image rows

Kristen Grauman

Better Parameterization

slide-20
SLIDE 20

Better Parameterization

NOTE: Large Accumulator More memory and computations Improvement: (Finite Accumulator Array Size) Line equation: Here

∞ ≤ ≤ ∞ − m θ θ sin cos y x d − =

max

2 ρ ρ π θ ≤ ≤ ≤ ≤ ) , (

i i y

x y x

Image Space

ρ θ

Hough Space

?

slide-21
SLIDE 21

Image space Votes Horizontal axis is θ, vertical is ρ.

slide-22
SLIDE 22

Image space votes

slide-23
SLIDE 23

Mechanics of the Hough transform

  • Difficulties

– how big should the cells be? (too big, and we merge quite different lines; too small, and noise causes lines to be missed)

  • How many lines?

– Count the peaks in the Hough array – Treat adjacent peaks as a single peak

  • Which points belong to each

line? – Search for points close to the line – Solve again for line and iterate

slide-24
SLIDE 24

Image space edge coordinates Votes Here, everything appears to be “noise”, or random edge points, but we still see peaks in the vote space.

Mechanics of the Hough transform

slide-25
SLIDE 25

a0 b0 r (xi,yi) Equation of Circle:

2 i i

r = ) b (y + ) a (x

2 2

− −

If radius r is known:

x y x y a b (xi,yi)

Accumulator array A(a,b)

Finding Circles by Hough Transform

slide-26
SLIDE 26

Finding Circles by Hough Transform

Equation of Circle:

2 2 2

) ( ) ( r b y a x

i i

= − + −

If radius is not known: 3D Hough Space! Use Accumulator array

) , , ( r b a A

slide-27
SLIDE 27

Key issues:

  • can be generalized to fit any object that can

be parameterized

  • problems: running time (curse of

dimensionality), will fail for complex objects, size/resolution of cell in accumulator

  • Some heuristic improvements are possible

a0 b0 r (xi,yi) x y

Finding Circles by Hough Transform

slide-28
SLIDE 28

a0 x y

Circles: Hough Transform

Further reading: Ballard and Brown, hough.pdf

Image: Multi-subject Diffusion MRI Tractography via a Hough Transform Global Approach, Aganj et al.

slide-29
SLIDE 29

Example: iris detection

  • Hemerson Pistori and Eduardo Rocha Costa

http://rsbweb.nih.gov/ij/plugins/hough-circles.html Gradient+threshold Hough space (fixed radius) Max detections

Kristen Grauman

slide-30
SLIDE 30

Hough transform: pros and cons

Pros

  • All points are processed independently, so can cope with
  • cclusion, gaps due to poor signal contrast
  • Some robustness to noise: noise points unlikely to

contribute consistently to any single bin

  • Can detect multiple instances of a model in a single pass

Cons

  • Complexity of search time increases exponentially with

the number of model parameters

  • Non-target shapes can produce spurious peaks in

parameter space

  • Quantization: can be tricky to pick a good grid size

Kristen Grauman

slide-31
SLIDE 31
  • Hough line demo
  • http://www.dis.uniroma1.it/~iocchi/slides/icr

a2001/java/hough.html

slide-32
SLIDE 32

What if we want to detect arbitrary shapes?

Kristen Grauman

Generalized Hough Transform

slide-33
SLIDE 33

What if we want to detect arbitrary shapes? Intuition:

Kristen Grauman

Generalized Hough Transform

slide-34
SLIDE 34

Model image

What if we want to detect arbitrary shapes? Intuition:

Kristen Grauman

Generalized Hough Transform

slide-35
SLIDE 35

Model image

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Kristen Grauman

Generalized Hough Transform

slide-36
SLIDE 36

Model image

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-37
SLIDE 37

Model image Novel image

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-38
SLIDE 38

Model image Vote space Novel image

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-39
SLIDE 39

Model image Vote space Novel image x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-40
SLIDE 40

Model image Vote space Novel image x x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-41
SLIDE 41

Model image Vote space Novel image x x x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-42
SLIDE 42

Model image Vote space Novel image x x x x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-43
SLIDE 43

Model image Vote space Novel image x x x x x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-44
SLIDE 44

Model image Vote space Novel image x x x x x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-45
SLIDE 45

Model image Vote space Novel image x x x x x

What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-46
SLIDE 46

Model image Vote space Novel image x x x x x

Now suppose those colors encode gradient directions… What if we want to detect arbitrary shapes? Intuition:

  • Ref. point

Displacement vectors

Kristen Grauman

Generalized Hough Transform

slide-47
SLIDE 47
  • Define a model shape by its boundary points and a

reference point.

[Dana H. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, 1980]

x a

p1

θ

p2

θ

Offline procedure:

Model shape

Kristen Grauman

Generalized Hough Transform

slide-48
SLIDE 48
  • Define a model shape by its boundary points and a

reference point.

[Dana H. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, 1980]

x a

p1

θ

p2

θ

At each boundary point, compute displacement vector: r = a – pi. Offline procedure:

Model shape

Kristen Grauman

Generalized Hough Transform

slide-49
SLIDE 49
  • Define a model shape by its boundary points and a

reference point.

[Dana H. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, 1980]

x a

p1

θ

p2

θ

At each boundary point, compute displacement vector: r = a – pi. Offline procedure:

Model shape

Kristen Grauman

Generalized Hough Transform

slide-50
SLIDE 50
  • Define a model shape by its boundary points and a

reference point.

[Dana H. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, 1980]

x a

p1

θ

p2

θ

At each boundary point, compute displacement vector: r = a – pi. Store these vectors in a table indexed by gradient orientation θ. Offline procedure:

Model shape

Kristen Grauman

Generalized Hough Transform

slide-51
SLIDE 51
  • Define a model shape by its boundary points and a

reference point.

[Dana H. Ballard, Generalizing the Hough Transform to Detect Arbitrary Shapes, 1980]

x a

p1

θ

p2

θ

At each boundary point, compute displacement vector: r = a – pi. Store these vectors in a table indexed by gradient orientation θ. Offline procedure:

Model shape

θ θ

… … …

Kristen Grauman

Generalized Hough Transform

slide-52
SLIDE 52

p1

For each edge point: Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

Novel image

θ θ

… … …

Kristen Grauman

Generalized Hough Transform

slide-53
SLIDE 53

p1

For each edge point:

  • Use its gradient orientation θ

to index into stored table

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

Novel image

θ θ

… … …

Kristen Grauman

Generalized Hough Transform

slide-54
SLIDE 54

p1

θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

θ

Novel image

θ θ

… … …

θ

Kristen Grauman

Generalized Hough Transform

slide-55
SLIDE 55

p1

θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

θ

Novel image

θ θ

… … …

θ

Kristen Grauman

Generalized Hough Transform

slide-56
SLIDE 56

p1

θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

θ

Novel image

θ θ

… … …

θ

Kristen Grauman

Generalized Hough Transform

slide-57
SLIDE 57

p1

θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

x

θ

Novel image

θ θ

… … …

θ

x x Kristen Grauman

Generalized Hough Transform

slide-58
SLIDE 58

p1

θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

x

θ

Novel image

θ θ

… … …

θ

x x Kristen Grauman

Generalized Hough Transform

slide-59
SLIDE 59

p1

θ θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

x

θ θ

Novel image

θ θ

… … …

θ

x x Kristen Grauman

Generalized Hough Transform

slide-60
SLIDE 60

p1

θ θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

x

θ θ

Novel image

θ θ

… … …

θ

x x Kristen Grauman

Generalized Hough Transform

slide-61
SLIDE 61

p1

θ θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

x

θ θ

Novel image

θ θ

… … …

θ

x x x x Kristen Grauman

Generalized Hough Transform

slide-62
SLIDE 62

p1

θ θ

For each edge point:

  • Use its gradient orientation θ

to index into stored table

  • Use retrieved r vectors to

vote for reference point

Detection procedure:

Assuming translation is the only transformation here, i.e., orientation and scale are fixed.

x

θ θ

Novel image

θ θ

… … …

θ

x x x x Kristen Grauman

Generalized Hough Transform

slide-63
SLIDE 63

Find shortest path from s to t.

s 3 t 2 6 7 4 5

24 18 2 9 14 15 5 30 20 44 16 11 6 19 6

Live wires: shortest path

from Tardos/Kleinberg book

slide-64
SLIDE 64

Live Wires: Intelligent Scissors

  • Today’s Readings

– Intelligent Scissors, Mortensen et. al, SIGGRAPH 1995

slide-65
SLIDE 65

Extracting objects

  • How could this be done?

– hard to do manually – hard to do automatically – easy to do semi-automatically

slide-66
SLIDE 66

Extracting objects

slide-67
SLIDE 67

Intelligent Scissors

  • Approach answers a

basic question – Q: how to find a path from seed to mouse that follows

  • bject boundary as

closely as possible? – A: define a path that stays as close as possible to edges

slide-68
SLIDE 68
  • Basic Idea

– Define edge score for each pixel

  • edge pixels have low cost

– Find lowest cost path from seed to mouse

seed mouse

Questions

  • How to define costs?
  • How to find the path?

Intelligent Scissors

slide-69
SLIDE 69

seed mouse

Questions

  • How to define costs?
  • How to find the path?
  • Basic Idea

– Define edge score for each pixel

  • edge pixels have low cost

– Find lowest cost path from seed to mouse

Intelligent Scissors

slide-70
SLIDE 70

Node: pixel Edge: cost of path or cut between two pixels

Intelligent Scissors

slide-71
SLIDE 71
  • Treat the image as a graph

Graph

  • node for every pixel p
  • link between every adjacent pair of pixels, p,q
  • cost c for each link

Note: each link has a cost

  • this is a little different than the figure before where

each pixel had a cost

p q c

Intelligent Scissors

slide-72
SLIDE 72

Path Search (basic idea)

  • Graph Search Algorithm

– Computes minimum cost path from seed to all other pixels

Note: diagonal “paths” are scaled by a factor .

2

… Why?

slide-73
SLIDE 73

After object rotation

L

Should be invariant to image rotation

slide-74
SLIDE 74

After object rotation

L

Path’s cost along the top boundary Path’s cost along the top-left boundary

14 7 * 2 = 10 5 * 2 =

After diagonal links are adjusted by 2

14 5 * 2 * 2 =

2 2 2 2 2 2 2 2 2 2 2 2

image gradient scores

Should be invariant to image rotation

slide-75
SLIDE 75
  • good (low-cost) links follow the intensity edge

– want intensity to change rapidly ⊥ to the link

|intensity of r – intensity of s|

Want to hug image edges: how to define cost of a link? p q c r s

Defining the cost

slide-76
SLIDE 76

p q c

  • c can be computed using a cross-correlation filter

– assume it is centered at p

Defining the cost

slide-77
SLIDE 77

p q c

1

  • 1

w

  • 1
  • 1

1 1

c can be computed using a cross-correlation filter

  • assume it is centered at p

A couple more modifications

  • Scale the filter response by length of link c.
  • Make c positive

– Set c = (max-|filter response|*length) – where max = maximum |filter response|*length over all pixels in the image

Defining the cost

slide-78
SLIDE 78

 Is the pixel an edge pixel? Evaluate Laplacian zero crossings  How good is this edge pixel? Gradient magnitude  What is its orientation? Gradient direction

Evaluate for each pair of neighboring pixels and compute the cost accordingly

invert the edge gradients (high gradient -> small cost) variation between the two unit vectors

Other options to calculate edge cost

slide-79
SLIDE 79

Dijkstra’s shortest path algorithm

5 3 1 3 3 4 9 2 Algorithm

1. init node costs to ฀, set p = seed point, cost(p) = 0 2. expand p as follows:

for each of p’s neighbors q that are not expanded

» set cost(q) = min( cost(p) + cpq, cost(q) )

link cost

slide-80
SLIDE 80

4 1 5 3 3 2 3 9 Algorithm

1. init node costs to ฀, set p = seed point, cost(p) = 0 2. expand p as follows:

for each of p’s neighbors q that are not expanded

» set cost(q) = min( cost(p) + cpq, cost(q) )

» if q’s cost changed, make q point back to p

» put q on the ACTIVE list (if not already there)

5 3 1 3 3 4 9 2 1 1

Dijkstra’s shortest path algorithm

slide-81
SLIDE 81

4 1 5 3 3 2 3 9 5 3 1 3 3 4 9 2 1 5 2 3 3 3 2 4 Algorithm

1. init node costs to ฀, set p = seed point, cost(p) = 0 2. expand p as follows:

for each of p’s neighbors q that are not expanded

» set cost(q) = min( cost(p) + cpq, cost(q) )

» if q’s cost changed, make q point back to p

» put q on the ACTIVE list (if not already there)

3. set r = node with minimum cost on the ACTIVE list 4. repeat Step 2 for p = r

Dijkstra’s shortest path algorithm

slide-82
SLIDE 82

3 1 5 3 3 2 3 6 5 3 1 3 3 4 9 2 4 3 1 4 5 2 3 3 3 2 4 Algorithm

1. init node costs to ฀, set p = seed point, cost(p) = 0 2. expand p as follows:

for each of p’s neighbors q that are not expanded

» set cost(q) = min( cost(p) + cpq, cost(q) )

» if q’s cost changed, make q point back to p

» put q on the ACTIVE list (if not already there)

3. set r = node with minimum cost on the ACTIVE list 4. repeat Step 2 for p = r

Dijkstra’s shortest path algorithm

slide-83
SLIDE 83

A B

Dijkstra algorithm

  • processed nodes (distance to A is known)
  • active nodes (front)
  • active node with the smallest distance value

Dijkstra’s shortest path algorithm

slide-84
SLIDE 84
  • Properties

– It computes the minimum cost path from the seed to every node in the graph. This set of minimum paths is represented as a tree – Running time, with N pixels:

  • O(N2) time if you use an active list
  • O(N log N) if you use an active priority queue (heap)
  • takes fraction of a second for a typical (640x480) image

– Once this tree is computed once, we can extract the

  • ptimal path from any point to the seed in O(N) time.
  • it runs in real time as the mouse moves

– What happens when the user specifies a new seed?

Dijkstra’s shortest path algorithm

slide-85
SLIDE 85

A B

The arrows indicate the direction of the path with minimum cumulative cost.

image: Antonio Criminisi and Sing Bing Kang

Live wires and Intelligent scissors

slide-86
SLIDE 86

Live wires and Intelligent scissors: examples

image: Sharon Eve

slide-87
SLIDE 87

Live wires and Intelligent scissors: examples

slide-88
SLIDE 88

Live wires and Intelligent scissors: examples

slide-89
SLIDE 89

Live wires and Intelligent scissors: examples