<s>
Semi-global	B-General_Concept
matching	I-General_Concept
(	O
SGM	O
)	O
is	O
a	O
computer	B-Application
vision	I-Application
algorithm	O
for	O
the	O
estimation	O
of	O
a	O
dense	O
disparity	O
map	O
from	O
a	O
rectified	B-Algorithm
stereo	B-Algorithm
image	I-Algorithm
pair	I-Algorithm
,	O
introduced	O
in	O
2005	O
by	O
Heiko	O
Hirschmüller	O
while	O
working	O
at	O
the	O
German	O
Aerospace	O
Center	O
.	O
</s>
<s>
Given	O
its	O
predictable	O
run	O
time	O
,	O
its	O
favourable	O
trade-off	O
between	O
quality	O
of	O
the	O
results	O
and	O
computing	O
time	O
,	O
and	O
its	O
suitability	O
for	O
fast	O
parallel	O
implementation	O
in	O
ASIC	O
or	O
FPGA	B-Architecture
,	O
it	O
has	O
encountered	O
wide	O
adoption	O
in	O
real-time	B-General_Concept
stereo	O
vision	O
applications	O
such	O
as	O
robotics	O
and	O
advanced	O
driver	O
assistance	O
systems	O
.	O
</s>
<s>
Pixelwise	O
stereo	O
matching	O
allows	O
to	O
perform	O
real-time	B-General_Concept
calculation	O
of	O
disparity	O
maps	O
by	O
measuring	O
the	O
similarity	O
of	O
each	O
pixel	O
in	O
one	O
stereo	O
image	O
to	O
each	O
pixel	O
within	O
a	O
subset	O
in	O
the	O
other	O
stereo	O
image	O
.	O
</s>
<s>
Given	O
a	O
rectified	B-Algorithm
stereo	B-Algorithm
image	I-Algorithm
pair	I-Algorithm
,	O
for	O
a	O
pixel	O
with	O
coordinates	O
the	O
set	O
of	O
pixels	O
in	O
the	O
other	O
image	O
is	O
usually	O
selected	O
as	O
,	O
where	O
is	O
a	O
maximum	O
allowed	O
disparity	O
shift	O
.	O
</s>
<s>
Such	O
constraint	O
can	O
be	O
efficiently	O
enforced	O
on	O
a	O
per-scanline	O
basis	O
by	O
using	O
dynamic	B-Algorithm
programming	I-Algorithm
(	O
e.g.	O
</s>
<s>
the	O
Viterbi	B-Algorithm
algorithm	I-Algorithm
)	O
,	O
but	O
such	O
limitation	O
can	O
still	O
introduce	O
streaking	O
artefacts	O
in	O
the	O
depth	O
map	O
,	O
because	O
little	O
or	O
no	O
regularisation	O
is	O
performed	O
across	O
scanlines	O
.	O
</s>
<s>
submodular	B-Algorithm
functions	I-Algorithm
)	O
a	O
solution	O
with	O
strong	O
optimality	O
properties	O
can	O
be	O
found	O
in	O
polynomial	O
time	O
using	O
graph	B-Algorithm
cut	I-Algorithm
optimization	I-Algorithm
,	O
however	O
such	O
global	O
methods	O
are	O
generally	O
too	O
expensive	O
for	O
real-time	B-General_Concept
processing	O
.	O
</s>
<s>
The	O
former	O
can	O
be	O
in	O
principle	O
any	O
local	O
image	O
dissimilarity	O
measure	O
,	O
and	O
commonly	O
used	O
functions	O
are	O
absolute	O
or	O
squared	O
intensity	O
difference	O
(	O
usually	O
summed	O
over	O
a	O
window	O
around	O
the	O
pixel	O
,	O
and	O
after	O
applying	O
a	O
high-pass	O
filter	O
to	O
the	O
images	O
to	O
gain	O
some	O
illumination	O
invariance	O
)	O
,	O
Birchfield	B-General_Concept
–	I-General_Concept
Tomasi	I-General_Concept
dissimilarity	I-General_Concept
,	O
Hamming	O
distance	O
of	O
the	O
census	B-Algorithm
transform	I-Algorithm
,	O
Pearson	O
correlation	O
(	O
normalized	O
cross-correlation	O
)	O
.	O
</s>
<s>
Further	O
post-processing	O
techniques	O
for	O
the	O
refinement	O
of	O
the	O
disparity	O
image	O
include	O
morphological	B-Algorithm
filtering	O
to	O
remove	O
outliers	O
,	O
intensity	O
consistency	O
checks	O
to	O
refine	O
textureless	O
regions	O
,	O
and	O
interpolation	O
to	O
fill	O
in	O
pixels	O
invalidated	O
by	O
consistency	O
checks	O
.	O
</s>
