dr. ulas bagci bagci@ucfbagci/teaching/computervision16/lec13.pdfdr. ulas bagci [email protected]...
TRANSCRIPT
![Page 1: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/1.jpg)
CAP5415-ComputerVisionLecture13-AdvancedImageSegmentation
(OptimizationProblem)
Lecture13:AdvancedImageSegmentation
1
![Page 2: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/2.jpg)
Reminders• Oct18GuestLecture(Lecture17)Dr.Borji
–BasicsofHumanVisionSystem• Oct20GuestLecture(Lecture18)Dr.Gong
–DeepLearning(CNN,RNN,LSTM,GRU)
• Selectyourprojectby15th ofOctober(UseWebCourse!)
2
Lecture13:AdvancedImageSegmentation
![Page 3: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/3.jpg)
Labeling &Segmentation• Labeling isacommonwayformodelingvariouscomputervisionproblems(e.g.opticalflow,imagesegmentation,stereomatching,etc)
3
Lecture13:AdvancedImageSegmentation
![Page 4: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/4.jpg)
Labeling &Segmentation• Labeling isacommonwayformodelingvariouscomputervisionproblems(e.g.opticalflow,imagesegmentation,stereomatching,etc)
• Thesetoflabelscanbediscrete(asinimagesegmentation)
4
Lecture13:AdvancedImageSegmentation
L = {l1, . . . , lm} with L = m
![Page 5: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/5.jpg)
Labeling &Segmentation• Labeling isacommonwayformodelingvariouscomputervisionproblems(e.g.opticalflow,imagesegmentation,stereomatching,etc)
• Thesetoflabelscanbediscrete(asinimagesegmentation)
• Orcontinuous(asinopticalflow)
5
Lecture13:AdvancedImageSegmentation
L = {l1, . . . , lm} with L = m
L ⇢ Rnfor n � 1
![Page 6: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/6.jpg)
Labelingisafunction• Labelsareassignedtosites (pixellocations)
6
Lecture13:AdvancedImageSegmentation
![Page 7: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/7.jpg)
Labelingisafunction• Labelsareassignedtosites (pixellocations)• Foragivenimage,wehave
7
Lecture13:AdvancedImageSegmentation
|⌦| = Ncols
.Nrows
![Page 8: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/8.jpg)
Labelingisafunction• Labelsareassignedtosites (pixellocations)• Foragivenimage,wehave• Identifyingalabelingfunction(withsegmentation)is
8
Lecture13:AdvancedImageSegmentation
|⌦| = Ncols
.Nrows
f : ⌦ ! L
![Page 9: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/9.jpg)
Labelingisafunction• Labelsareassignedtosites (pixellocations)• Foragivenimage,wehave• Identifyingalabelingfunction(withsegmentation)is
Weaimatcalculatingalabelingfunctionthatminimizesagiven(total)errororenergy
9
Lecture13:AdvancedImageSegmentation
|⌦| = Ncols
.Nrows
f : ⌦ ! L
![Page 10: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/10.jpg)
Labelingisafunction• Labelsareassignedtosites (pixellocations)• Foragivenimage,wehave• Identifyingalabelingfunction(withsegmentation)is
Weaimatcalculatingalabelingfunctionthatminimizesagiven(total)errororenergy
*Aisanadjacencyrelationbetweenpixellocations10
Lecture13:AdvancedImageSegmentation
|⌦| = Ncols
.Nrows
f : ⌦ ! L
E(f) =X
p2⌦
[Edata
(p, fp
) +X
q2A(p)
Esmooth
(fp
, fq
)]
![Page 11: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/11.jpg)
EnergyFunctionTheroleofanenergyfunctioninminimization-basedvisionistwofold:
1. asthequantitativemeasureoftheglobalqualityofthesolutionand
2. asaguidetothesearchforaminimalsolution.
Correctsolutionisembeddedastheminimum.11
Lecture13:AdvancedImageSegmentation
![Page 12: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/12.jpg)
SegmentationasanEnergyMinimizationProblem
• Edata assignsnon-negativepenaltiestoapixellocation pwhenassigningalabeltothislocation.
12
Lecture13:AdvancedImageSegmentation
![Page 13: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/13.jpg)
SegmentationasanEnergyMinimizationProblem
• Edata assignsnon-negativepenaltiestoapixellocation pwhenassigningalabeltothislocation.
• Esmooth assignsnon-negativepenaltiesbycomparingtheassignedlabelsfp andfq atadjacentpositionsp andq.
13
Lecture13:AdvancedImageSegmentation
![Page 14: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/14.jpg)
SegmentationasanEnergyMinimizationProblem
• Edata assignsnon-negativepenaltiestoapixellocation pwhenassigningalabeltothislocation.
• Esmooth assignsnon-negativepenaltiesbycomparingtheassignedlabelsfp andfq atadjacentpositionsp andq.
14
Lecture13:AdvancedImageSegmentation
![Page 15: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/15.jpg)
SegmentationasanEnergyMinimizationProblem
• Edata assignsnon-negativepenaltiestoapixellocation pwhenassigningalabeltothislocation.
• Esmooth assignsnon-negativepenaltiesbycomparingtheassignedlabelsfp andfq atadjacentpositionsp andq.
Thisoptimizationmodelischaracterizedbylocalinteractionsalongedgesbetweenadjacentpixels,andoftencalledMRF(MarkovRandomField)model.
15
Lecture13:AdvancedImageSegmentation
![Page 16: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/16.jpg)
EnergyFunction-Details
16
Lecture13:AdvancedImageSegmentation
E(f) =X
p2⌦
[Edata
(p, fp
) +X
q2A(p)
Esmooth
(fp
, fq
)]
![Page 17: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/17.jpg)
EnergyFunction-Details
• SampleDataTerm:
17
Lecture13:AdvancedImageSegmentation
E(f) =X
p2⌦
[Edata
(p, fp
) +X
q2A(p)
Esmooth
(fp
, fq
)]
Edata(p, fp) = (p)
(p = 0) = �logP (p 2 BG)
(p = 1) = �logP (p 2 FG)
![Page 18: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/18.jpg)
EnergyFunction-Details
• SampleDataTerm:
• SampleSmoothnessTerm:
18
Lecture13:AdvancedImageSegmentation
E(f) =X
p2⌦
[Edata
(p, fp
) +X
q2A(p)
Esmooth
(fp
, fq
)]
Edata(p, fp) = (p)
(p = 0) = �logP (p 2 BG)
(p = 1) = �logP (p 2 FG)
(p, q) = Kpq�(p 6= q) where
Kpq =exp(��(Ip � Iq)2/(2�2))
||p, q||
![Page 19: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/19.jpg)
EnergyFunction-Details
19
Lecture13:AdvancedImageSegmentation
E(p) =X
p2⌦
p(p) +X
p2⌦
X
q2A(p)
pq(p, q)
p⇤ = argminp2L
E(p)
![Page 20: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/20.jpg)
EnergyFunction-Details
• Tosolvethisproblem,transformtheenergyfunctionalintomin-cut/max-flowproblemandsolveit!
20
Lecture13:AdvancedImageSegmentation
E(p) =X
p2⌦
p(p) +X
p2⌦
X
q2A(p)
pq(p, q)
p⇤ = argminp2L
E(p)
![Page 21: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/21.jpg)
EnergyFunction
21
Lecture13:AdvancedImageSegmentation
UnaryCost(dataterm)
DiscontinuityCost
p q
![Page 22: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/22.jpg)
Recap:ImageasaGraph
22
Lecture13:AdvancedImageSegmentation
Node/vertexEdge
pixel
p q
![Page 23: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/23.jpg)
GraphCutsforOptimalBoundaryDetection(BoykovICCV2001)
23
Lecture13:AdvancedImageSegmentation
F
B
F
B
F
F F
F B
B
B
• Binarylabel:foregroundvs.background• Userlabelssomepixels• Exploit
– StatisticsofknownFg &Bg– Smoothnessoflabel
• Turnintodiscretegraphoptimization– Graphcut(mincut/maxflow)
![Page 24: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/24.jpg)
Graph-Cut
24
Lecture13:AdvancedImageSegmentation
EachpixelisconnectedtoitsneighborsinanundirectedgraphGoal:splitnodesintotwosetsAandBbasedonpixelvalues,andtrytoclassifyNeighborsinthesamewaytoo!
![Page 25: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/25.jpg)
Graph-Cut
25
Lecture13:AdvancedImageSegmentation
EachpixelisconnectedtoitsneighborsinanundirectedgraphGoal:splitnodesintotwosetsAandBbasedonpixelvalues,andtrytoclassifyNeighborsinthesamewaytoo!
![Page 26: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/26.jpg)
Graph-Cut
26
Lecture13:AdvancedImageSegmentation
• Eachpixel=node• AddtwonodesF&B• Labeling:linkeachpixeltoeitherForB
F
B
F
B
F
F F
F B
B
B
Desiredresult
![Page 27: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/27.jpg)
CostFunction:Dataterm
27
Lecture13:AdvancedImageSegmentation
• PutoneedgebetweeneachpixelandbothF&G• Weightofedge=minusdataterm
B
F
![Page 28: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/28.jpg)
CostFunction:Smoothnessterm
28
Lecture13:AdvancedImageSegmentation
• Addanedgebetweeneachneighborpair• Weight=smoothnessterm
B
F
![Page 29: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/29.jpg)
Min-Cut
29
Lecture13:AdvancedImageSegmentation
• Energyoptimizationequivalenttographmincut• Cut:removeedgestodisconnectFfromB• Minimum:minimizesumofcutedgeweight
B
Fcut
![Page 30: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/30.jpg)
Min-Cut
30
Lecture13:AdvancedImageSegmentation
Source
Sink
v1 v2
2
5
9
42
1Graph (V, E, C)
Vertices V = {v1, v2 ... vn}Edges E = {(v1, v2) ....}Costs C = {c(1, 2) ....}
![Page 31: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/31.jpg)
Min-Cut
31
Lecture13:AdvancedImageSegmentation
Source
Sink
v1 v2
2
5
9
42
1
Whatisast-cut?
Anst-cut(S,T)divides thenodesbetweensourceandsink.
Whatisthecostofast-cut?
SumofcostofalledgesgoingfromStoT
5 + 2 + 9 = 16
![Page 32: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/32.jpg)
Min-Cut
32
Lecture13:AdvancedImageSegmentation
Whatisast-cut?
Anst-cut(S,T)divides thenodesbetweensourceandsink.
Whatisthecostofast-cut?
SumofcostofalledgesgoingfromStoT
Source
Sink
v1 v2
2
5
9
42
1
2 + 1 + 4 = 7
Whatisthest-mincut?
st-cutwiththeminimumcost
![Page 33: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/33.jpg)
Howtocomputemin-cut?
33
Lecture13:AdvancedImageSegmentation
Source
Sink
v1 v2
2
5
9
42
1
Solve the dual maximum flow problem
In every network, the maximum flow equals the cost of the st-mincut
Min-cut\Max-flow Theorem
Compute the maximum flow between Source and Sink
Constraints
Edges: Flow < Capacity
Nodes: Flow in & Flow out
![Page 34: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/34.jpg)
Max-FlowAlgorithms
34
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Source
Sink
v1 v2
2
5
9
42
1
Algorithms assume non-negative capacity
Flow=0
![Page 35: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/35.jpg)
Max-FlowAlgorithms
35
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
2
5
9
42
1
Flow=0
![Page 36: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/36.jpg)
Max-FlowAlgorithms
36
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
2-2
5-2
9
42
1
Flow=0+2
![Page 37: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/37.jpg)
Max-FlowAlgorithms
37
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
3
9
42
1
Flow=2
![Page 38: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/38.jpg)
Max-FlowAlgorithms
38
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
3
9
42
1
Flow=2
![Page 39: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/39.jpg)
Max-FlowAlgorithms
39
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
3
9
42
1
Flow=2
![Page 40: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/40.jpg)
Max-FlowAlgorithms
40
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
3
5
02
1
Flow=2+4
![Page 41: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/41.jpg)
Max-FlowAlgorithms
41
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
3
5
02
1
Flow=6
![Page 42: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/42.jpg)
Max-FlowAlgorithms
42
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
3
5
02
1
Flow=6
![Page 43: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/43.jpg)
Max-FlowAlgorithms
43
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
2
4
02+1
1-1
Flow=6+1
![Page 44: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/44.jpg)
Max-FlowAlgorithms
44
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
2
4
03
0
Flow=7
![Page 45: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/45.jpg)
Max-FlowAlgorithms
45
Lecture13:AdvancedImageSegmentation
Augmenting Path Based Algorithms
1. Find path from source to sink with positive capacity
2. Push maximum possible flow through this path
3. Repeat until no path can be found
Algorithms assume non-negative capacity
Source
Sink
v1 v2
0
2
4
03
0
Flow=7
![Page 46: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/46.jpg)
AnotherExample-MaxFlow
46
Lecture13:AdvancedImageSegmentation
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
![Page 47: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/47.jpg)
AnotherExample-MaxFlow
47
Lecture13:AdvancedImageSegmentation
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
![Page 48: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/48.jpg)
AnotherExample-MaxFlow
48
Lecture13:AdvancedImageSegmentation
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 3
![Page 49: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/49.jpg)
AnotherExample-MaxFlow
49
Lecture13:AdvanceImageSegmentation
source
sink
9
5
6-3
8-3
42+3
2
2
5-3
3-3
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 3
+3
![Page 50: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/50.jpg)
AnotherExample-MaxFlow
50
Lecture13:AdvancedImageSegmentation
source
sink
9
5
3
5
45
2
2
2
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 3
3
![Page 51: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/51.jpg)
AnotherExample-MaxFlow
51
Lecture13:AdvancedImageSegmentation
source
sink
9
5
3
5
45
2
2
2
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 3
3
![Page 52: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/52.jpg)
AnotherExample-MaxFlow
52
Lecture13:AdvancedImageSegmentation
source
sink
9
5
3
5
45
2
2
2
5
5
311
6
2
3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 6
3
![Page 53: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/53.jpg)
AnotherExample-MaxFlow
53
Lecture13:AdvancedImageSegmentation
source
sink
9-3
5
3
5-3
45
2
2
2
5
5
3-311
6
2
3-3
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 6
3
+3
+3
![Page 54: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/54.jpg)
AnotherExample-MaxFlow
54
Lecture13:AdvancedImageSegmentation
source
sink
6
5
3
2
45
2
2
2
5
5
11
6
2
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 6
3
3
3
![Page 55: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/55.jpg)
AnotherExample-MaxFlow
55
Lecture13:AdvancedImageSegmentation
source
sink
6
5
3
2
45
2
2
2
5
5
11
6
2
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 6
3
3
3
![Page 56: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/56.jpg)
AnotherExample-MaxFlow
56
Lecture13:AdvancedImageSegmentation
source
sink
6
5
3
2
45
2
2
2
5
5
11
6
2
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 11
3
3
3
![Page 57: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/57.jpg)
AnotherExample-MaxFlow
57
Lecture13:AdvancedImageSegmentation
source
sink
6-5
5-5
3
2
45
2
2
2
5-5
5-5
1+51
6
2+5
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 11
3
3
3
![Page 58: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/58.jpg)
AnotherExample-MaxFlow
58
Lecture13:AdvancedImageSegmentation
source
sink
1
3
2
45
2
2
2
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 11
3
33
![Page 59: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/59.jpg)
AnotherExample-MaxFlow
59
Lecture13:AdvancedImageSegmentation
source
sink
1
3
2
45
2
2
2
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 11
3
33
![Page 60: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/60.jpg)
AnotherExample-MaxFlow
60
Lecture13:AdvancedImageSegmentation
source
sink
1
3
2
45
2
2
2
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 13
3
33
![Page 61: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/61.jpg)
AnotherExample-MaxFlow
61
Lecture13:AdvancedImageSegmentation
source
sink
1
3
2-2
45
2-2
2-2
2-2
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 13
3
33
+2
+2
![Page 62: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/62.jpg)
AnotherExample-MaxFlow
62
Lecture13:AdvancedImageSegmentation
source
sink
1
3
45
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 13
3
33
2
2
![Page 63: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/63.jpg)
AnotherExample-MaxFlow
63
Lecture13:AdvancedImageSegmentation
source
sink
1
3
45
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 13
3
33
2
2
![Page 64: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/64.jpg)
AnotherExample-MaxFlow
64
Lecture13:AdvancedImageSegmentation
source
sink
1
3
45
61
6
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 15
3
33
2
2
![Page 65: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/65.jpg)
AnotherExample-MaxFlow
65
Lecture13:AdvancedImageSegmentation
source
sink
1
3-2
4-25
61
6-2
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 15
3
33+2
2
2-2
+2
![Page 66: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/66.jpg)
AnotherExample-MaxFlow
66
Lecture13:AdvancedImageSegmentation
source
sink
1
1
5
61
4
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 15
3
35
2
2
2
![Page 67: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/67.jpg)
AnotherExample-MaxFlow
67
Lecture13:AdvancedImageSegmentation
source
sink
1
1
5
61
4
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 15
3
35
2
2
2
![Page 68: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/68.jpg)
AnotherExample-MaxFlow
68
Lecture13:AdvancedImageSegmentation
source
sink
1
1
5
61
4
7
Ford & Fulkerson algorithm (1956)
Find the path from source to sink
While (path exists)
flow += maximum capacity in the path
Build the residual graph (“subtract” the flow)
Find the path in the residual graph
End
flow = 15
3
35
2
2
2
![Page 69: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/69.jpg)
AnotherExample-MaxFlow
69
Lecture13:AdvancedImageSegmentation
source
sink
1
1
5
61
4
7
Ford & Fulkerson algorithm (1956)
Why is the solution globally optimal ?
flow = 15
3
35
2
2
2
![Page 70: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/70.jpg)
AnotherExample-MaxFlow
70
Lecture13:AdvancedImageSegmentation
source
sink
1
1
5
61
4
7
Ford & Fulkerson algorithm (1956)
Why is the solution globally optimal ?
1. Let S be the set of reachable nodes in the
residual graph
flow = 15
3
35
2
2
2
S
![Page 71: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/71.jpg)
AnotherExample-MaxFlow
71
Lecture13:AdvancedImageSegmentation
Ford & Fulkerson algorithm (1956)
Why is the solution globally optimal ?
1. Let S be the set of reachable nodes in the
residual graph
2. The flow from S to V - S equals to the sum
of capacities from S to V – S
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
S
![Page 72: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/72.jpg)
AnotherExample-MaxFlow
72
Lecture13:AdvancedImageSegmentation
flow = 15
Ford & Fulkerson algorithm (1956)
Why is the solution globally optimal ?
1. Let S be the set of reachable nodes in the residual graph
2. The flow from S to V - S equals to the sum of capacities from S to V – S
3. The flow from any A to V - A is upper bounded by the sum of capacities from A to V – A
4. The solution is globally optimal
source
sink
8/9
5/5
5/6
8/8
2/40/2
2/2
0/2
5/5
3/3
5/5
5/5
3/30/10/1
2/6
0/2
3/3
Individual flows obtained by summing up all paths
![Page 73: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/73.jpg)
AnotherExample-MaxFlow
73
Lecture13:AdvancedImageSegmentation
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
S
T
cost = 18
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
S
T
![Page 74: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/74.jpg)
AnotherExample-MaxFlow
74
Lecture13:AdvancedImageSegmentation
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
S
T
cost = 23
![Page 75: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/75.jpg)
AnotherExample-MaxFlow
75
Lecture13:AdvancedImageSegmentation
C(x) = 5x1 + 9x2 + 4x3 + 3x3(1-x1) + 2x1(1-x3)
+ 3x3(1-x1) + 2x2(1-x3) + 5x3(1-x2) + 2x4(1-x1)
+ 1x5(1-x1) + 6x5(1-x3) + 5x6(1-x3) + 1x3(1-x6)
+ 3x6(1-x2) + 2x4(1-x5) + 3x6(1-x5) + 6(1-x4)
+ 8(1-x5) + 5(1-x6)
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
x1 x2
x3
x4
x5
x6
![Page 76: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/76.jpg)
AnotherExample-MaxFlow
76
Lecture13:AdvancedImageSegmentation
C(x) = 2x1 + 9x2 + 4x3 + 2x1(1-x3)
+ 3x3(1-x1) + 2x2(1-x3) + 5x3(1-x2) + 2x4(1-x1)
+ 1x5(1-x1) + 3x5(1-x3) + 5x6(1-x3) + 1x3(1-x6)
+ 3x6(1-x2) + 2x4(1-x5) + 3x6(1-x5) + 6(1-x4)
+ 5(1-x5) + 5(1-x6)
+ 3x1 + 3x3(1-x1) + 3x5(1-x3) + 3(1-x5)
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
x1 x2
x3
x4
x5
x6
![Page 77: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/77.jpg)
AnotherExample-MaxFlow
77
Lecture13:AdvancedImageSegmentation
C(x) = 2x1 + 9x2 + 4x3 + 2x1(1-x3)
+ 3x3(1-x1) + 2x2(1-x3) + 5x3(1-x2) + 2x4(1-x1)
+ 1x5(1-x1) + 3x5(1-x3) + 5x6(1-x3) + 1x3(1-x6)
+ 3x6(1-x2) + 2x4(1-x5) + 3x6(1-x5) + 6(1-x4)
+ 5(1-x5) + 5(1-x6)
+ 3x1 + 3x3(1-x1) + 3x5(1-x3) + 3(1-x5)
3x1 + 3x3(1-x1) + 3x5(1-x3) + 3(1-x5)
=
3 + 3x1(1-x3) + 3x3(1-x5)
source
sink
9
5
6
8
42
2
2
5
3
5
5
311
6
2
3
x1 x2
x3
x4
x5
x6
![Page 78: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/78.jpg)
AnotherExample-MaxFlow
78
Lecture13:AdvancedImageSegmentation
C(x) = 3 + 2x1 + 6x2 + 4x3 + 5x1(1-x3)
+ 3x3(1-x1) + 2x2(1-x3) + 5x3(1-x2) + 2x4(1-x1)
+ 1x5(1-x1) + 3x5(1-x3) + 5x6(1-x3) + 1x3(1-x6)
+ 2x5(1-x4) + 6(1-x4)
+ 2(1-x5) + 5(1-x6) + 3x3(1-x5)
+ 3x2 + 3x6(1-x2) + 3x5(1-x6) + 3(1-x5)
3x2 + 3x6(1-x2) + 3x5(1-x6) + 3(1-x5)
=
3 + 3x2(1-x6) + 3x6(1-x5)
source
sink
9
5
3
5
45
2
2
2
5
5
311
6
2
33
x1 x2
x3
x4
x5
x6
![Page 79: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/79.jpg)
AnotherExample-MaxFlow
79
Lecture13:AdvancedImageSegmentation
C(x) = 6 + 2x1 + 6x2 + 4x3 + 5x1(1-x3)
+ 3x3(1-x1) + 2x2(1-x3) + 5x3(1-x2) + 2x4(1-x1)
+ 1x5(1-x1) + 3x5(1-x3) + 5x6(1-x3) + 1x3(1-x6)
+ 2x5(1-x4) + 6(1-x4) + 3x2(1-x6) + 3x6(1-x5)
+ 2(1-x5) + 5(1-x6) + 3x3(1-x5)
source
sink
6
5
3
2
45
2
2
2
5
5
11
6
2
3
3
3
x1 x2
x3
x4
x5
x6
![Page 80: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/80.jpg)
AnotherExample-MaxFlow
80
Lecture13:AdvancedImageSegmentation
C(x) = 15 + 1x2 + 4x3 + 5x1(1-x3)
+ 3x3(1-x1) + 7x2(1-x3) + 2x1(1-x4)
+ 1x5(1-x1) + 6x3(1-x6) + 6x3(1-x5)
+ 2x5(1-x4) + 4(1-x4) + 3x2(1-x6) + 3x6(1-x5)
source
sink
1
1
5
61
4
7
3
35
2
2
2x1 x2
x3
x4
x5
x6 cost = 0
min cut
S
T
cost = 0
• All coefficients positive
• Must be global minimum
S – set of reachable nodes from s
![Page 81: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/81.jpg)
HistoryofMax-FlowAlgorithms
81
Lecture13:AdvancedImageSegmentation
Augmenting Path and Push-Relabel
n:#nodesm:#edgesU:maximumedgeweight
Algorithms assume non-negative edge
weights
![Page 82: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/82.jpg)
ExampleSegmentationinaVideo
82
Lecture13:AdvancedImageSegmentation
Image Flow GlobalOptimum
pqw
n-links st-cuts
t
= 0
= 1
E(x) x*
![Page 83: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/83.jpg)
SegmentationExample
83
Lecture13:AdvancedImageSegmentation
![Page 84: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/84.jpg)
SegmentationExample
84
Lecture13:AdvancedImageSegmentation
![Page 85: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/85.jpg)
SegmentationExample
85
Lecture13:AdvancedImageSegmentation
![Page 86: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/86.jpg)
Optimality?
86
Lecture13:AdvancedImageSegmentation
Seeds GrabCut(iterativeGCWithboxprior)
![Page 87: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/87.jpg)
VascularSurfaceSegmentationviaGC10/1/15
87
Lecture13:AdvancedImageSegmentation
![Page 88: Dr. Ulas Bagci bagci@ucfbagci/teaching/computervision16/Lec13.pdfDr. Ulas Bagci bagci@ucf.edu Lecture 13: Advanced Image Segmentation 1. Reminders • Oct 18 Guest Lecture (Lecture](https://reader031.vdocuments.net/reader031/viewer/2022022507/5ac948217f8b9a6b578ce5b3/html5/thumbnails/88.jpg)
SlideCreditsandReferences• Fredo DurandofMIT• M.Tappen ofAmazon• R.Szelisky,Univ.ofWashington/Seatle• http://www.csd.uwo.ca/faculty/yuri/Abstracts/eccv06-tutorial.html• J.Malcolm,GraphCutinTensorScale• InteractiveGraphCutsforOptimalBoundary&RegionSegmentationofObjectsin
N-Dimages.YuriBoykov andMarie-Pierre Jolly.InInternationalConference onComputerVision,(ICCV),vol.I,2001.http://www.csd.uwo.ca/~yuri/Abstracts/iccv01-abs.html
• http://www.cse.yorku.ca/~aaw/Wang/MaxFlowStart.htm• http://research.microsoft.com/vision/cambridge/i3l/segmentation/GrabCut.htm• http://www.cc.gatech.edu/cpl/projects/graphcuttextures/• AComparativeStudyofEnergyMinimizationMethodsforMarkovRandomFields.
RickSzeliski,Ramin Zabih,DanielScharstein,OlgaVeksler,VladimirKolmogorov,Aseem Agarwala,MarshallTappen,Carsten Rother.ECCV2006www.cs.cornell.edu/~rdz/Papers/SZSVKATR.pdf
• P.Kumar,OxfordUniversity.
88
Lecture13:AdvancedImageSegmentation