(1 slide per page)

38
Image Processing - Lesson 12 Segmentation • Threshold Segmentation • Local thresholding • Edge thresholding • Threshold using averaging • Gradient Detectors • Region Growing • Split & Merge • Shape Matching • Shape Representation

Upload: doanbao

Post on 24-Jan-2017

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: (1 slide per page)

Image Processing - Lesson 12

Segmentation

• Threshold Segmentation

• Local thresholding

• Edge thresholding

• Threshold using averaging

• Gradient Detectors

• Region Growing

• Split & Merge

• Shape Matching

• Shape Representation

Page 2: (1 slide per page)

Segmentation

Image Segmentation = divide image into (continuous)regions or sets of pixels.

1) Region Based

2) Boundary Based

3) Edge Based

Page 3: (1 slide per page)

Thresholding

Global Thresholding = Choose threshold T that separates object from background.

BackgroundObject

TGraylevel

# of

Pix

els

Image Histogram

Page 4: (1 slide per page)

0 100 2000

500

1000

1500

Segmentation using Thresholding

Original Histogram

50 75

Threshold = 50 Threshold = 75

Page 5: (1 slide per page)

0 100 2000

500

1000

1500

Original Histogram

21

Threshold = 21

Page 6: (1 slide per page)

Thresholding a Grayscale Image

Original Image Thresholded Image

Threshold too low Threshold too high

Page 7: (1 slide per page)

FMRI - Example

Original Image Threshold = 80

Threshold = 71 Threshold = 88

Page 8: (1 slide per page)

Simple thresholding is not always possible:

Graylevel

# of

Pix

els

Image Histogram

1) Many objects at different gray levels.

2) Variations in background gray level.

3) Noise in image.

Page 9: (1 slide per page)

Thresholding Example

Original

0 100 2000

50

100

150Histogram

Single Global Threshold

0 100 2000

50

100

150

T = 128

Page 10: (1 slide per page)

Local Thresholding - 4 ThresholdsDivide image in to regions. Perform thresholding

independently in each region.

0 100 2000

50

100

0 100 2000

50

100

0 100 2000

50

100

0 100 2000

50

100

T = 80 T = 128 T = 188 T = 226

Page 11: (1 slide per page)

Adaptive Thresholding

Every pixel in image is thresholded according to thehistogram of the pixel neighborhood.

0 50 1000

100

200

x-coordinate

Thre

shol

d Le

vel

T =

Page 12: (1 slide per page)

Adaptive Thresholding - Example

Original

Global Threshold Adaptive Threshold

Page 13: (1 slide per page)

Threshold Segmentation of Noisy Images

Noise inhibits localization of threshold.

Graylevel

# of

Pix

els

Image Histogram

Smooth image and obtain a histogram for whichthreshold is easily determined.

Graylevel

# of

Pix

els

Image Histogram

T

Page 14: (1 slide per page)

Note: Smooth the image, not the histogram...

Graylevel

# of

Pix

els

Image Histogram

Graylevel

# of

Pix

els

Image Histogram

Page 15: (1 slide per page)

Threshold using Average

Gray level

Gray level Histograms

no p

ixel

s

0 50 100 150 200 2500

5000

10000

Page 16: (1 slide per page)

Threshold using Average

Gray level

no p

ixel

s

0 50 100 150 200 2500

50

100

0 50 100 150 200 2500

200

400

Gray level

Gray level Histograms

Page 17: (1 slide per page)

Edge Based Segmentation

Edge ImageOriginal

ObjectBackground

Page 18: (1 slide per page)

Edge Based Thresholding

Original Edge Pixels Edge Neighbors

0 50 100 150 200 2500

50

100

150

200

Edge Neighbors Histogram

Page 19: (1 slide per page)

Thresholding Based on Boundary Characteristics

Original Threshold (T=182)l

0 100 2000

1000

2000

3000

Global Histogram

Page 20: (1 slide per page)

Thresholding Based on Boundary Characteristics

Original Threshold (T=143)l

0 100 2000

5

10

15

20

Edge Neighborhood Histogram

Page 21: (1 slide per page)

Region Growing

Define:

S = the set of pixels inside the region.

Q = queue of pixels to be checked.

(x0,y0) = a pixel inside the region.

Initialize: S = ∅

Q = { (x0,y0) }

1) Extract pixel P from queue Q

2) Add P to S.

3) For each neighbor P' of P:

if P' is "similar" to P and P' ∉ S then

add P' to Q.

4) If Q = ∅ then end, else return to 1.

Algorithm:

S = the extracted pixels of the region.Define what "similar" means.Problematic in small gradient regions.

Page 22: (1 slide per page)

Region Growing - Example

Seed

Page 23: (1 slide per page)

Region Growing - Examples

Color Segmentation

Texture Segmentation

Color + Texture Segmentation

Page 24: (1 slide per page)

Watershed Threshold Algorithm

An Image can be viewed as a topographic map

T0

Tn

Thre

shol

d Le

vel

Image location

Page 25: (1 slide per page)

Watershed Threshold Algorithm

Original T = 149 T = 150

Thre

shol

d Le

vel

T0

Tn

Image location

Initialize threshold at T0 that separates objects well.Determine connected components. Raise threshold, and detect pixels that pass threshold and belong to more than one connected component.Do not let objects merge. Set these pixels as object boundaries.

Page 26: (1 slide per page)

Watershed Threshold Algorithm

Page 27: (1 slide per page)

Watershed Threshold Algorithm

Original Watershed Boundaries

Watershed Markers Watershed Boundaries

Watershed Markers may be chosen manually or local global maximas (as above)

Page 28: (1 slide per page)

Split & Merge Segmentation

2 Stage Algorithm:

Stage 1: SplitSplit image into regions using a Quad Tree representation.

Stage 2: MergeMerge "leaves" of the Quad Tree which are neighboring and "similar".

Original Split Split + Merge

Page 29: (1 slide per page)

Quad Tree - RepresentationImage Quad Tree

1 2 3 4

1 2

3 4

Demo

Page 30: (1 slide per page)

Quad Tree Representation

Original

Thresh = 0.20

Thresh = 0.40

Thresh = 0.55

Page 31: (1 slide per page)

Split & Merge Example

Stage 1: Split

Stage 2: Merge

Page 32: (1 slide per page)

Split & Merge Example

Page 33: (1 slide per page)

Graph-Cut Segmentation

Wij

ji Wij

G = { V , E }

V = verticesE = Edges

V = image pixelsE = pixel similarity

Segmentation = Graph Partitioning

Page 34: (1 slide per page)

Min-Cut Segmentation

cut

A

B

∑∈∈

=BjAi

ijWBAcut,

),(

Segmentation by min-cut:

Find A,B such that cut(A,B) is minimal.

(Wu and Leahy 1993)

Page 35: (1 slide per page)

Normalized-Cut Segmentation

⎟⎟⎠

⎞⎜⎜⎝

⎛+= ∑

∈∈ )(1

)(1),(

, BvolAvolWBANcutBjAi

ij

Segmentation by normalized-cut:

Find A,B such that Ncut(A,B) is minimal.

(Shi and Malik 2000)

cut

Min-cut segmentation favors small segments.

∑∈∈

=AjAi

ijWAvol,

)(where

Page 36: (1 slide per page)

Normalized-Cut Segmentation -Examples

(from Cohen-Or 2005)

Page 37: (1 slide per page)

Shape Matching / Object Recognition

Model #1 Model #2 Model #3 Model #4

? ?? ?

Which Model matches the Measurement?• Which Model • What is the transformation from Model to Measurement(translation, rotation, scale,…)

Page 38: (1 slide per page)