74
Digital Image Processing, 3rd ed. Digital Image Processing, 3rd ed. www.ImageProcessingPlace.com Gonzalez & Woods Ch t 10 Ch t 10 Chapter 10 Segmentation Chapter 10 Segmentation Image Segmentation Subdividing an image into different regions based on some criterion/criteria. © 1992–2008 R. C. Gonzalez & R. E. Woods

Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Image Segmentationg gSubdividing an image into different regions based on some criterion/criteria.

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 2: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Image Derivativesg1. First order generally produces

thick edges2. Second order has stronger

response to fine detailresponse to fine detail3. Second order derivates may

produce double edges (in ramp and step transition intensities).

4. The sign of the second derivative indicates whether the transition from dark to light or light to darklight or light to dark

)()1(

2

f

xfxfxf

© 1992–2008 R. C. Gonzalez & R. E. Woods

)1()(2)2(2 xfxfxf

xf

Page 3: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Detection of Isolate PointsThe advantages of the second derivative implies using the Laplacian

22 ff

),1(),(2),2(

),(

2

2

2

2

2

22

yxfyxfyxfxf

yf

xfyxf

),(4)2,(),2(),(

)1,(),(2)2,(

2

2

2

yxfyxfyxfyxf

yxfyxfyxfyf

)1,(),1( yxfyxf

A point at location (x,y) can be detected using its response g(x,y)

R(x y) is the result of applying a filter

© 1992–2008 R. C. Gonzalez & R. E. Woods

otherwise

TyxRyxg

0|),(|1

),(

R(x,y) is the result of applying a filter at the location x,y

Page 4: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Line Detection Lines are detected by 1. Finding the points of the

lines2. Collect these points into

line.

Applying Laplacian on an image.1. Original2. Laplacian Result3. Absolute value4. Positive only

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 5: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Line/Edge Detection g1. The points along the lines do not

usually fall on an ideal line.2. The line may not be continuous.

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 6: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Edge ModelsgThe transition from a bright intensity to dark one, have different patterns.

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 7: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Edge ModelsgThe existence of noise complicate line detection therefore1. Image smoothing often contribute

to noise reduction.2. Detection of edge points- potential

candidates for edge points.3 d l li i l i3. Edge localization- to select points

which are actually on the lines.

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 8: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Image Gradientg

x xf

gfgradf )(

yx

y

ggfmagyxM

xfg

fgradf

22)(),(

)(

x

y

yx

gg

yx

ggfgy

1tan),(

)(),(

Gradient is often expressed as

yx ggyxM ),(

© 1992–2008 R. C. Gonzalez & R. E. Woods

y

Page 9: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Robert operation

)( 59

f

zzxfgx

p

)( 68 zzyfg y

The simplest approximation of partial

)()( 321987 zzzzzzxfgx

dervatives on 3x3 mask

)()( 741963 zzzzzzyfg y

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 10: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 11: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 12: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 13: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 14: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 15: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 16: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Marr-Hildreth Edge DetectorMarr and Hildreh argued1. Intensity changes are not independent

of image scale2 The studden change in intensity show2. The studden change in intensity show

a peak in the first derivative and zero crossing in the second

2

22

2)( yx

eyxG

2

22

2

22

2

2

2

22

2

),(),(),(

),(

yxyx yx

yyxG

xyxGyxG

eyxG

2

22

2

22

22

224

22

24

2

22

22

11

yxyx

eyex

eyy

exx

This expression is often called Laplacian of Gaussian

© 1992–2008 R. C. Gonzalez & R. E. Woods

2

22

24

222 2

yx

eyx

This expression is often called Laplacian of Gaussian (LoG)

Page 17: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 18: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Canny Edge Detector1. Low error rate2. Edge point should be well localized3. Single edge point response

Algorithm1. Smooth image with a Gaussian

- optimizes the trade-off between noisefiltering and edge localization

2. Compute the Gradient magnitude using approximations of partial derivatives

3 Thi d b l i i3. Thin edges by applying non-maxima suppression to the gradient magnitude

4. Detect edges by double thresholding

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 19: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Gradient

• At each point convolve with

11

11

G

• magnitude and orientation of the Gradient are

1111

xG

11

yG

• magnitude and orientation of the Gradient are computed as

22 ],[],[],[ jiQjiPjiM

A id fl i i i h i f f i

],[],[],[ jQjj

]),[],,[(tan],[ 1 jiPjiQji

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 19

• Avoid floating point arithmetic for fast computation

Page 20: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Non-Maxima Suppression

Chapter 10Segmentation

Chapter 10Segmentation

• Thin edges by keeping large values of GradientThin edges by keeping large values of Gradient– not always at the location of an edge– there are many thick edgesy g

1312100031110000

010012300011231001121200

120102321010023201001230

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 20

12010232

Page 21: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Non-Maxima Suppression (2)

Chapter 10Segmentation

Chapter 10Segmentation

• Thin the broad ridges in M[i,j] into ridges that are only one i l idpixel wide

• Find local maxima in M[i,j] by suppressing all values along the line of the Gradient that are not peak values of the ridge

1312100331110000

0011231001121200

falseedges

120102321010023231001230

gaps

edges

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 21

12010232

Page 22: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Gradient Orientation

Chapter 10Segmentation

Chapter 10Segmentation

• Reduce angle of Gradient θ[i,j] to one of the 4 sectorsReduce angle of Gradient θ[i,j] to one of the 4 sectors• Check the 3x3 region of each M[i,j]• If the value at the center is not greater than the 2• If the value at the center is not greater than the 2

values along the gradient, then M[i,j] is set to 0

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 22

Page 23: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

local31110000maxima

0112120013121000

removed

depends010012300011231001121200

dependson condition

1010023201001230

12010232

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 23

Page 24: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10 30000000 Chapter 10Segmentation

Chapter 10Segmentation

0312000030000000

0000030000021200

false edges

0000023000000300 g

0201003010100030

• The suppressed magnitude image will contain many false edges caused by noise or fine texture

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 24

false edges caused by noise or fine texture

Page 25: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Thresholding

Chapter 10Segmentation

Chapter 10Segmentation

g

• Reduce number of false edges by applying aReduce number of false edges by applying a threshold T

all values below T are changed to 0– all values below T are changed to 0– selecting a good values for T is difficult

some false edges will remain if T is too low– some false edges will remain if T is too low– some edges will disappear if T is too high

d ill di d t ft i f th– some edges will disappear due to softening of the edge contrast by shadows

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 25

Page 26: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Double Thresholding

Chapter 10Segmentation

Chapter 10Segmentation

g

• Apply two thresholds in the suppressed imageApply two thresholds in the suppressed image– T2 = 2T2

– two images in the outputg p– the image from T2 contains fewer edges but has gaps in the

contours h i f h f l d– the image from T1 has many false edges

– combine the results from T1 and T2

link the edges of T into contours until we reach a gap– link the edges of T2 into contours until we reach a gap– link the edge from T2 with edge pixels from a T1 contour

until a T2 edge is found again

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 26

2

Page 27: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10T2=2 T =1Chapter 10Segmentation

Chapter 10Segmentation

T2 2 T1=1

0302000030000000

0312000030000000

000003000002020003020000

000003000002120003120000

gapsfilled

0000003000000230

1010003000000230from

T1

02000030 02010030

• A T2 contour has pixels along the green arrowsA T2 contour has pixels along the green arrows• Linking: search in a 3x3 of each pixel and connect the

pixel at the center with the one having greater valueS h i th di ti f th d (di ti f G di t)

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 27

• Search in the direction of the edge (direction of Gradient)

Page 28: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Line Detection

Chapter 10Segmentation

Chapter 10Segmentation

• Model of a line: two edges with oppositeModel of a line: two edges with opposite polarity in distance less than the size of the smoothing filterg– edge detection filters respond to step edges– they do not provide meaningful response to lines

• Apply nonmaxima suppression on the smoothed output– a line is the derivative of a step the derivative

step of the Canny algorithm is not necessary

© 1992–2008 R. C. Gonzalez & R. E. WoodsCanny Edge Detector 28

Page 29: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 30: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 31: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 32: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 33: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 34: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 35: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 36: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 37: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 38: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 39: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 40: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

ThresholdingThresholding1. Select initial estimate2. Segment the images using T into two

groups G1 and G2groups G1 and G2 3. Compute the averages of the two

groups m1 and m2.4. Computer a new threshold as

T = (m1+m2)/25. Repeat 2..4 until the difference

between two successive thresholds is less than t.

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 41: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 42: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 43: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 44: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Optimal ThresholdingOptimal Thresholding1

1

0

L

iip

Suppose we select a thershold T(k)Suppose we select a thershold T(k)

)(0

1 pkPk

ii

)(1)( 1

1

12 kPpkP

L

kii

The mean intensity in each group is

)(/)()()(

)()(

1)(/)()()(010

110

11

BPAPABPBAP

iiPkP

CiPiCiPCiiPkmk

i

k

i

k

i

© 1992–2008 R. C. Gonzalez & R. E. Woods

)(/)()()( BPAPABPBAP

Page 45: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Optimal ThresholdingOptimal Thresholding

111

)(1)(/)()()(LLL

iiPCiPiCiPCiiPkm

The mean intensity of the second group is

121

221

22 )()(

)(/)()()(kikiki

iiPkP

CiPiCiPCiiPkm

The accumulative mean up to k level is

The average intensity of the entire image is:

k

ik)( 1Lg

i

iipkm0

)(

0

)(i

iG ipkm

2211 mPmPmG

1

22 )(L

iG pmi2211G

)](1)[()()( 2

12

kPkPkmkPmG

B

0

)(i

iG p

© 1992–2008 R. C. Gonzalez & R. E. Woods

)](1)[( 11 kPkP

Page 46: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Optimal ThresholdingOptimal Thresholding

2

2B

We can measure goodness of the threshold at level k is

2G

1

0

22 )(L

iiGG pmiWhere

and )( 212222 mPmG

Taking k into account

)()( 2kmkPm

and)1()()()()(

21

122121

222

211

2

PPmPmmmPPmmPmmP G

GGB

2 )(k

The optimum threshold k* is

)](1)[()()()(

11

12

kPkPkmkPmk G

B

2

)()(G

B kk

Where

© 1992–2008 R. C. Gonzalez & R. E. Woods

))((max)( 2

10

*2 kk BLkB

Page 47: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

Otsu’s Algorithm for Optimal ThresholdOtsu s Algorithm for Optimal Threshold1. Compute the normalized histogram (pi) of the input image2. Compute the accumulative sum Pk for k=0, .., L-13 C h l i f k 0 L 13. Compute the accumulative mean mk for k=0, .., L-14. Compute the global intensity mean mG5. Compute the between class variance 6 Obtain the Otus threshold k* as the value of k that maximize

)(2 kB)(2 kB6. Obtain the Otus threshold k* as the value of k that maximize

7. Obtain the separablility measure at k = k*)(B

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 48: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 49: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 50: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 51: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 52: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 53: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 54: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 55: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 56: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 57: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 58: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 59: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 60: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 61: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 62: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 63: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 64: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 65: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 66: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 67: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 68: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 69: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 70: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 71: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 72: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 73: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods

Page 74: Subdividing an image into different regions based on some …dip111/wiki.files/DIP3E... · 2011-01-21 · Digital Image Processing, 3rd ed. Gonzalez & Woods Ch t 10 Non-Maxima Suppression

Digital Image Processing, 3rd ed.Digital Image Processing, 3rd ed.

www.ImageProcessingPlace.com

Gonzalez & Woods

Ch t 10Ch t 10Chapter 10Segmentation

Chapter 10Segmentation

© 1992–2008 R. C. Gonzalez & R. E. Woods