Image segmentation

7,987 views 53 slides Dec 12, 2019
Slide 1
Slide 1 of 53
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53

About This Presentation

Digital image segmentation, Digital image processing


Slide Content

DIGITAL IMAGE PROCESSING
IMAGE SEGMENTATION

Introduction
•Imagesegmentationdividesanimageintoregionsthatare
connectedandhavesomesimilaritywithintheregionand
somedifferencebetweenadjacentregions.
•Thegoalisusuallytofindindividualobjectsinanimage.
•Forthemostparttherearefundamentallytwokindsof
approachestosegmentation:discontinuityandsimilarity.
–Similaritymaybeduetopixelintensity,colorortexture.
–Differencesaresuddenchanges(discontinuities)inanyofthese,but
especiallysuddenchangesinintensityalongaboundaryline,whichis
calledanedge.

Detection of Discontinuities
•Therearethreekindsofdiscontinuitiesofintensity:points,
linesandedges.
•Themostcommonwaytolookfordiscontinuitiesistoscana
smallmaskovertheimage.Themaskdetermineswhichkind
ofdiscontinuitytolookfor.


9
1
992211
...
i
ii
zwzwzwzwR

Detection of Discontinuities
Point Detection thresholdenonnegativ a: whereT
TR

Detection of Discontinuities
Line Detection
•Onlyslightlymorecommonthanpointdetectionistofinda
onepixelwidelineinanimage.
•Fordigitalimagestheonlythreepointstraightlinesareonly
horizontal,vertical,ordiagonal(+or–45).

Detection of Discontinuities
Line Detection

Detection of Discontinuities
Edge Detection

Detection of Discontinuities
Edge Detection

Detection of Discontinuities
Edge Detection

Detection of Discontinuities
Edge Detection

Detection of Discontinuities
Gradient Operators
•First-order derivatives:
–The gradient of an image f(x,y) at location (x,y) is defined
as the vector:
–The magnitudeof this vector:
–The directionof this vector:


















y
f
x
f
y
x
G
G
f  
2
1
22
)(mag
yx
GGf  f 









x
y
G
G
yx
1
tan),(

Detection of Discontinuities
Gradient Operators
Roberts cross-gradient operators
Prewitt operators
Sobel operators

Detection of Discontinuities
Gradient Operators
Prewitt masks for
detecting diagonal edges
Sobel masks for
detecting diagonal edges

yxGGf  Detection of Discontinuities
Gradient Operators: Example

Detection of Discontinuities
Gradient Operators: Example

Detection of Discontinuities
Gradient Operators: Example

Detection of Discontinuities
Gradient Operators
•Second-order derivatives: (The Laplacian)
–The Laplacian of an 2D function f(x,y) is defined as
–Two forms in practice:2
2
2
2
2
y
f
x
f
f







Detection of Discontinuities
Gradient Operators
•Consider the function:
•The Laplacian of his
•The Laplacian of a Gaussian sometimes is called the Mexican
hat function. It also can be computed bysmoothing the image
with the Gaussian smoothing mask, followed by application of
the Laplacian mask.deviation standard the: and
where)(
2222
2
2


yxrerh
r

 2
2
2
4
22
2
)(



r
e
r
rh








The Laplacian of a
Gaussian (LoG)
A Gaussian function

Detection of Discontinuities
Gradient Operators

Detection of Discontinuities
Gradient Operators: Example
Sobel gradient
Laplacian maskGaussian smooth function

Detection of Discontinuities
Gradient Operators: Example

Edge Linking and Boundary Detection
Local Processing
•Twopropertiesofedgepointsareusefulforedgelinking:
–thestrength(ormagnitude)ofthedetectededgepoints
–theirdirections(determinedfromgradientdirections)
•Thisisusuallydoneinlocalneighborhoods.
•Adjacentedgepointswithsimilarmagnitudeanddirectionare
linked.
•Forexample,anedgepixelwithcoordinates(x
0,y
0)ina
predefinedneighborhoodof(x,y)issimilartothepixelat(x,y)
if thresholdenonnegativ a: ,),(),(
00 EEyxyxf  thresholdangle nonegative a: ,),(),(
00 AAyxyx 

Edge Linking and Boundary Detection
Local Processing: Algorithm
1.Computethegradientmagnitudeandanglearrays,M(x,y)andα(x,
y),oftheinputimage,f(x,y).
2.Formabinaryimage,g(x,y),whosevalueatanypairof
coordinates(x,y)isgivenby:
whereT
Misathreshold,Aisaspecificangledirection,and±T
A
definesa“band”ofacceptabledirectionaboutA.
3.Scantherowsofgandfillallgapsineachrowthatdonotexceed
aspecifiedlength,K.
4.Todetectgapsinotherdirection,θ,rotategbythisangleand
applythehorizontalscanningprocedureinstep3.Rotatethe
resultbackby–θ.1, ( , ) AND ( , )
( , )
0, Otherwise
MA
M x y T x y A T
g x y
  


Edge Linking and Boundary Detection
Local Processing: Example
In this example,
we can find the
license plate
candidate after
edge linking
process.

Edge Linking and Boundary Detection
Global Processing via the Hough Transform

Edge Linking and Boundary Detection
Global Processing via the Hough Transform
•Houghtransform:awayoffindingedgepointsinanimage
thatliealongastraightline.
•Example:xy-planev.s.ab-plane(parameterspace)baxy
ii 

Edge Linking and Boundary Detection
Global Processing via the Hough Transform
•TheHoughtransformconsistsof
findingallpairsofvaluesof
andwhichsatisfytheequations
thatpassthrough(x,y).
•Theseareaccumulatedinwhatis
basicallya2-dimensional
histogram.
•Whenplottedthesepairsofand
willlooklikeasinewave.The
processisrepeatedforall
appropriate(x,y)locations. sincosyx

Edge Linking and Boundary Detection
Hough Transform Example
The intersection of the
curves corresponding
to points 1,3,5
2,3,4
1,4

Edge Linking and Boundary Detection
Hough Transform Example

Thresholding
•Assumption: the range of intensity levels covered by objects of
interest is different from the background.
Single thresholdMultiple threshold





Tyxf
Tyxf
yxg
),( if 0
),( if 1
),(

Thresholding
The Role of Illumination

Thresholding
The Role of Illumination
(a)(c)
(e)(d)),(),(),( yxryxiyxf  ),(yxi ),(yxr

Thresholding
Basic Global Thresholding

Thresholding
Basic Global Thresholding

Thresholding
Basic Adaptive Thresholding

Thresholding
Basic Adaptive Thresholding
How to solve this problem?

Thresholding
Basic Adaptive Thresholding
Answer: subdivision

Thresholding
Optimal Global and Adaptive Thresholding
•This method treats pixel values as probability density functions.
•The goal of this method is to minimize the probability of
misclassifying pixelsas either object or background.
•There are two kinds of error:
–mislabeling an object pixel as background, and
–mislabeling a background pixel as object.

Thresholding
Use of Boundary Characteristics

Thresholding
Thresholds Based on Several Variables
Color image

Region-Based Segmentation
•Edgesandthresholdssometimesdonotgivegood
resultsforsegmentation.
•Region-basedsegmentationisbasedonthe
connectivityofsimilarpixelsinaregion.
–Eachregionmustbeuniform.
–Connectivityofthepixelswithintheregionisvery
important.
•Therearetwomainapproachestoregion-based
segmentation:regiongrowingandregionsplitting.

Region-Based Segmentation
Basic Formulation
•Let Rrepresent the entire image region.
•Segmentation is a process that partitions Rinto subregions,
R
1,R
2,…,R
n, such that
where P(R
k): a logical predicate defined over the points in set R
k
For example: P(R
k)=TRUE if all pixels in R
k have the same gray
level.RR
i
n
i

1
(a) jijiRR
ji  , and allfor (c)  niR
i ,...,2,1 region, connected a is (b)  niRP
i ,...,2,1for TRUE)( (d)  jiji RRRRP and regionsadjacent any for FALSE)( (e) 

Region-Based Segmentation
Region Growing

Region-Based Segmentation
Region Growing
•Fig. 10.41 shows the histogram of Fig. 10.40 (a). It is difficult to
segment the defects by thresholding methods. (Applying region
growing methods are better in this case.)
Figure 10.41
Figure 10.40(a)

Region-Based Segmentation
Region Splitting and Merging
•Regionsplittingistheoppositeofregiongrowing.
–Firstthereisalargeregion(possibletheentireimage).
–Thenapredicate(measurement)isusedtodetermineifthe
regionisuniform.
–Ifnot,thenthemethodrequiresthattheregionbesplitinto
tworegions.
–Theneachofthesetworegionsisindependentlytestedby
thepredicate(measurement).
–Thisprocedurecontinuesuntilallresultingregionsare
uniform.

Region-Based Segmentation
Region Splitting
•Themainproblemwithregionsplittingisdeterminingwhereto
splitaregion.
•Onemethodtodividearegionistouseaquadtreestructure.
•Quadtree:atreeinwhichnodeshaveexactlyfourdescendants.

Region-Based Segmentation
Region Splitting and Merging
•Thesplitandmergeprocedure:
–SplitintofourdisjointquadrantsanyregionR
iforwhich
P(R
i)=FALSE.
–MergeanyadjacentregionsR
jandR
kforwhichP(R
jUR
k)=
TRUE.(thequadtreestructuremaynotbepreserved)
–Stopwhennofurthermergingorsplittingispossible.

Segmentation by Morphological Watersheds
•Theconceptofwatershedsisbasedonvisualizinganimagein
threedimensions:twospatialcoordinatesversusgraylevels.
•Insuchatopographicinterpretation,weconsiderthreetypesof
points:
–(a)pointsbelongingtoaregionalminimum
–(b)pointsatwhichadropofwaterwouldfallwithcertainty
toasingleminimum
–(c)pointsatwhichwaterwouldbeequallylikelytofallto
morethanonesuchminimum
•Theprincipalobjectiveofsegmentationalgorithmsbasedon
theseconceptsistofindthewatershedlines.

Segmentation by Morphological Watersheds
Example

Segmentation by Morphological Watersheds
Example

Segmentation by Morphological Watersheds
Example

The Use of Motion in Segmentation
•ADI: accumulative difference image

The Use of Motion in Segmentation