Professional Documents
Culture Documents
MRF
MRF
Applications1
intro, applications
MRF, labeling . . .
Please note that the lecture will be accompanied be several sketches and derivations on the blackboard
and few live-interactive demos in Matlab
From wikipedia2:
A Markov random field, Markov network or undirected graphical model is a
graphical model in which a set of random variables have a Markov property
described by an undirected graph.
More formal definition, which we follow, can be found in the first chapter3
of the book [4].
2
3
http://en.wikipedia.org/wiki/Markov_random_field
freely available at: http://www.nlpr.ia.ac.cn/users/szli/MRF_Book/MRF_Book.html
From wikipedia2:
A Markov random field, Markov network or undirected graphical model is a
graphical model in which a set of random variables have a Markov property
described by an undirected graph.
More formal definition, which we follow, can be found in the first chapter3
of the book [4].
Let think about images:
2
3
http://en.wikipedia.org/wiki/Markov_random_field
freely available at: http://www.nlpr.ia.ac.cn/users/szli/MRF_Book/MRF_Book.html
From wikipedia2:
A Markov random field, Markov network or undirected graphical model is a
graphical model in which a set of random variables have a Markov property
described by an undirected graph.
More formal definition, which we follow, can be found in the first chapter3
of the book [4].
2
3
http://en.wikipedia.org/wiki/Markov_random_field
freely available at: http://www.nlpr.ia.ac.cn/users/szli/MRF_Book/MRF_Book.html
Sites
S index a discrete set of m sites.
S = {1, . . . , m}
individual pixel
image region
intensity value
object label
...
Ordering of labels
6/50
.
.
.
L
{z
}
|
m times
image restoration
region segmentation
edge detection
stereo
9/50
...
P (fi)
iS
P (f ) = Z
T1 U (f )
0.9
0.8
0.7
where
0.6
0.5
Z=
T1 U (f )
f F
is a normalizing constant.
0.4
0.3
0.2
0.1
0
0
energy term U
10
Gibbs distribution
12/50
T1 U (f )
P (f ) = Z
P = e T U
T=0.5
T=1.0
T=2.0
T=5.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
energy term U
10
Energy function
13/50
U (f ) =
Vc(f )
cC
4
4
X
iS
V1(fi) +
X X
V2(fi, fi0 )
iS i0Ni
5
5
Energy minimization
16/50
T1 U (f )
U (f ) = Udata (f ) + Usmooth (f )
The data term measures how well a label fp fits the particular pixel (site) p.
Globally,
X
Udata (f ) =
Dp(fp)
pP
discontinuity preserving
Interacting pixels
18/50
Dp(fp) +
pP
Vp,q (fp, fq )
{p,q}N
labels , , L
V (, ) = 0 = ,
V (, ) = V (, ) 0 ,
(2)
V (, ) V (, ) + V (, )
(3)
(1)
Catch: finding global minimum is NP complete even for the simple Potts
model.
local minimum is sought.
Problem
Local minimum
21/50
22/50
We only sketch the main ideas from the seminal work [2]6
Allow more than just one label change at a time
Freely available implementation. Many difficult problems in computer vision were solved by using this
method and implementation.
7
image from [2]
Algorithm
23/50
Algorithm
24/50
Algorithm
25/50
- swap
26/50
- swap
27/50
8
8
32/50
Zkouka
33/50
Ptek 4.6.
Idea: denote few pixels that trully belongs to object or background and than
refine (grow) by using soft constraints.
Idea: denote few pixels that trully belongs to object or background and than
refine (grow) by using soft constraints.
Idea: denote few pixels that trully belongs to object or background and than
refine (grow) by using soft constraints.
Idea: denote few pixels that trully belongs to object or background and than
refine (grow) by using soft constraints.
data term
Idea: denote few pixels that trully belongs to object or background and than
refine (grow) by using soft constraints.
9
9
X
pobj
D(obj) +
D(bck)
pbck
The better match between pixel and obj or bck model the lower energy
(penalty).
D(obj) +
pobj
D(bck)
pbck
The better match between pixel and obj or bck model the lower energy
(penalty).
How to model?
histograms
for simplicity, you may think about the opposite case, the better match the
higher value
relative frequency
0.015
0.01
0.005
0
50
10
50
100
150
intensity
200
250
300
10
relative frequency
0.014
0.012
0.01
0.008
0.006
0.004
0.002
0
50
50
100
150
intensity
200
250
300
relative frequency
0.014
0.012
0.01
0.008
0.006
0.004
0.002
0
50
50
100
150
intensity
200
250
300
2D GMM
41/50
40
30
20
10
0
10
20
30
40
50
40
30
20
10
10
20
30
40
50
2D GMM
42/50
40
30
20
10
0
10
20
30
40
50
40
30
20
10
10
20
30
40
50
2D GMM
43/50
40
30
20
10
0
10
20
30
40
50
40
30
20
10
10
20
30
40
50
1
1
fi T
fi
fi 1
fi
(x
p(x|fi) =
wk
exp
(x
,
12
k
k
k)
2
d fi
k=1
(2) 2 k
44/50
Data term
5
4.5
4
D(obj) = ln p(x|obj)
D(bck) = ln p(x|bck)
data term
3.5
3
2.5
2
1.5
1
0.5
0
0
0.2
0.4
0.6
probability
0.8
11
The main idea: Iterate the graphcut and refine the data terms in each
iteration. Stop if the energy (penalty) does not decrease. [5]
The practical motivation
The main idea: Iterate the graphcut and refine the data terms in each
iteration. Stop if the energy (penalty) does not decrease. [5]
The practical motivation
Further reduce the user interaction.
12
12
GrabCut algorithm
48/50
References
49/50
[1] Yuri Boykov and Marie-Pierre Jolly. Interactive graph cuts for optimal boundary & region segmentation of
objects in N-D images. In Proceedings of International Conference on Computer Vision (ICCV), 2001.
[2] Yuri Boykov, Olga Veksler, and Ramin Zabih. Fast approximate energy minimization via graph cuts. IEEE
Transactions on Pattern Analysis and Machine Intelligence, 23(11):12221239, November 2001.
[3] S. Geman and D. Geman. Stochastic relaxation, gibbs distributions, and the bayesian restoration of
images. IEEE Transactions on Pattern Analysis and Machine Intelligence, 6(6):721741, 1984.
[4] Stan Z. Li. Markov Random Field Modeling in Image Analysis. Springer, 2009.
[5] Carsten Rother, Vladimir Kolomogorov, and Andrew Blake. GrabCut: Interactive foreground extraction
isong iterated graph cuts. ACM Transactions on Graphics (SIGGRAPH04), 2004.
[6] Tom Svoboda, Jan Kybic, and Vclav Hlav. Image Processing, Analysis and Machine Vision. A
MATLAB Companion. Thomson, 2007. Accompanying www site http://visionbook.felk.cvut.cz.
End
50/50
P = eU
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
energy term U
10
T1 U
P =e
T=0.5
T=1.0
T=2.0
T=5.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0
energy term U
10
relative frequency
0.015
0.01
0.005
0
50
50
100
150
intensity
200
250
300
individual Gaussians
0.018
0.016
relative frequency
0.014
0.012
0.01
0.008
0.006
0.004
0.002
0
50
50
100
150
intensity
200
250
300
Gaussian mixture
0.018
0.016
relative frequency
0.014
0.012
0.01
0.008
0.006
0.004
0.002
0
50
50
100
150
intensity
200
250
300
40
30
20
10
0
10
20
30
40
50
40
30
20
10
10
20
30
40
50
40
30
20
10
0
10
20
30
40
50
40
30
20
10
10
20
30
40
50
40
30
20
10
0
10
20
30
40
50
40
30
20
10
10
20
30
40
50
5
4.5
4
data term
3.5
3
2.5
2
1.5
1
0.5
0
0
0.2
0.4
0.6
probability
0.8