<s>
In	O
mathematical	B-Algorithm
morphology	I-Algorithm
,	O
hit-or-miss	B-Algorithm
transform	I-Algorithm
is	O
an	O
operation	O
that	O
detects	O
a	O
given	O
configuration	O
(	O
or	O
pattern	O
)	O
in	O
a	O
binary	B-Algorithm
image	I-Algorithm
,	O
using	O
the	O
morphological	B-Algorithm
erosion	I-Algorithm
operator	O
and	O
a	O
pair	O
of	O
disjoint	B-Algorithm
structuring	B-Algorithm
elements	I-Algorithm
.	O
</s>
<s>
The	O
result	O
of	O
the	O
hit-or-miss	B-Algorithm
transform	I-Algorithm
is	O
the	O
set	O
of	O
positions	O
where	O
the	O
first	O
structuring	B-Algorithm
element	I-Algorithm
fits	O
in	O
the	O
foreground	O
of	O
the	O
input	O
image	O
,	O
and	O
the	O
second	O
structuring	B-Algorithm
element	I-Algorithm
misses	O
it	O
completely	O
.	O
</s>
<s>
A	O
structuring	B-Algorithm
element	I-Algorithm
is	O
a	O
simple	O
,	O
pre-defined	O
shape	O
,	O
represented	O
as	O
a	O
binary	B-Algorithm
image	I-Algorithm
,	O
used	O
to	O
probe	O
another	O
binary	B-Algorithm
image	I-Algorithm
,	O
in	O
morphological	B-Algorithm
operations	I-Algorithm
such	O
as	O
erosion	B-Algorithm
,	O
dilation	B-Algorithm
,	O
opening	B-Algorithm
,	O
and	O
closing	B-Algorithm
.	O
</s>
<s>
Let	O
and	O
be	O
two	O
structuring	B-Algorithm
elements	I-Algorithm
satisfying	O
.	O
</s>
<s>
The	O
pair	O
(	O
C	O
,	O
D	O
)	O
is	O
sometimes	O
called	O
a	O
composite	O
structuring	B-Algorithm
element	I-Algorithm
.	O
</s>
<s>
The	O
hit-or-miss	B-Algorithm
transform	I-Algorithm
of	O
a	O
given	O
image	O
A	O
by	O
B	O
=(	O
C	O
,	O
D	O
)	O
is	O
given	O
by	O
:	O
</s>
<s>
That	O
is	O
,	O
a	O
point	O
x	O
in	O
E	O
belongs	O
to	O
the	O
hit-or-miss	B-Algorithm
transform	I-Algorithm
output	O
if	O
C	O
translated	O
to	O
x	O
fits	O
in	O
A	O
,	O
and	O
D	O
translated	O
to	O
x	O
misses	O
A	O
(	O
fits	O
the	O
background	O
of	O
A	O
)	O
.	O
</s>
<s>
Let	O
,	O
and	O
consider	O
the	O
eight	O
composite	O
structuring	B-Algorithm
elements	I-Algorithm
,	O
composed	O
of	O
:	O
</s>
<s>
The	O
corresponding	O
composite	O
structuring	B-Algorithm
elements	I-Algorithm
are	O
denoted	O
.	O
</s>
<s>
By	O
definition	O
,	O
the	O
hit-or-miss	B-Algorithm
transform	I-Algorithm
indicates	O
the	O
positions	O
where	O
a	O
certain	O
pattern	O
(	O
characterized	O
by	O
the	O
composite	O
structuring	B-Algorithm
element	I-Algorithm
B	O
)	O
occurs	O
in	O
the	O
input	O
image	O
.	O
</s>
<s>
Pruning	B-Algorithm
.	O
</s>
<s>
The	O
hit-or-miss	B-Algorithm
transform	I-Algorithm
can	O
be	O
used	O
to	O
identify	O
the	O
end-points	O
of	O
a	O
line	O
to	O
allow	O
this	O
line	O
to	O
be	O
shrunk	O
from	O
each	O
end	O
to	O
remove	O
unwanted	O
branches	O
.	O
</s>
