<s>
Random	B-Algorithm
sample	I-Algorithm
consensus	I-Algorithm
(	O
RANSAC	B-Algorithm
)	O
is	O
an	O
iterative	B-Algorithm
method	I-Algorithm
to	O
estimate	O
parameters	O
of	O
a	O
mathematical	O
model	O
from	O
a	O
set	O
of	O
observed	O
data	O
that	O
contains	O
outliers	O
,	O
when	O
outliers	O
are	O
to	O
be	O
accorded	O
no	O
influence	O
on	O
the	O
values	O
of	O
the	O
estimates	O
.	O
</s>
<s>
They	O
used	O
RANSAC	B-Algorithm
to	O
solve	O
the	O
Location	O
Determination	O
Problem	O
(	O
LDP	O
)	O
,	O
where	O
the	O
goal	O
is	O
to	O
determine	O
the	O
points	O
in	O
the	O
space	O
that	O
project	O
onto	O
an	O
image	O
into	O
a	O
set	O
of	O
landmarks	O
with	O
known	O
locations	O
.	O
</s>
<s>
RANSAC	B-Algorithm
uses	O
repeated	O
random	O
sub-sampling	O
.	O
</s>
<s>
RANSAC	B-Algorithm
also	O
assumes	O
that	O
,	O
given	O
a	O
(	O
usually	O
small	O
)	O
set	O
of	O
inliers	O
,	O
there	O
exists	O
a	O
procedure	O
which	O
can	O
estimate	O
the	O
parameters	O
of	O
a	O
model	O
that	O
optimally	O
explains	O
or	O
fits	O
this	O
data	O
.	O
</s>
<s>
Assuming	O
that	O
this	O
set	O
contains	O
both	O
inliers	O
,	O
i.e.	O
,	O
points	O
which	O
approximately	O
can	O
be	O
fitted	O
to	O
a	O
line	O
,	O
and	O
outliers	O
,	O
points	O
which	O
cannot	O
be	O
fitted	O
to	O
this	O
line	O
,	O
a	O
simple	B-General_Concept
least	I-General_Concept
squares	I-General_Concept
method	I-General_Concept
for	O
line	O
fitting	O
will	O
generally	O
produce	O
a	O
line	O
with	O
a	O
bad	O
fit	O
to	O
the	O
data	O
including	O
inliers	O
and	O
outliers	O
.	O
</s>
<s>
RANSAC	B-Algorithm
,	O
on	O
the	O
other	O
hand	O
,	O
attempts	O
to	O
exclude	O
the	O
outliers	O
and	O
find	O
a	O
linear	O
model	O
that	O
only	O
uses	O
the	O
inliers	O
in	O
its	O
calculation	O
.	O
</s>
<s>
The	O
RANSAC	B-Algorithm
algorithm	O
is	O
a	O
learning	O
technique	O
to	O
estimate	O
parameters	O
of	O
a	O
model	O
by	O
random	O
sampling	O
of	O
observed	O
data	O
.	O
</s>
<s>
Given	O
a	O
dataset	O
whose	O
data	O
elements	O
contain	O
both	O
inliers	O
and	O
outliers	O
,	O
RANSAC	B-Algorithm
uses	O
the	O
voting	O
scheme	O
to	O
find	O
the	O
optimal	O
fitting	O
result	O
.	O
</s>
<s>
The	O
RANSAC	B-Algorithm
algorithm	O
is	O
essentially	O
composed	O
of	O
two	O
steps	O
that	O
are	O
iteratively	O
repeated	O
:	O
</s>
<s>
The	O
RANSAC	B-Algorithm
algorithm	O
will	O
iteratively	O
repeat	O
the	O
above	O
two	O
steps	O
until	O
the	O
obtained	O
consensus	O
set	O
in	O
certain	O
iteration	O
has	O
enough	O
inliers	O
.	O
</s>
<s>
The	O
input	O
to	O
the	O
RANSAC	B-Algorithm
algorithm	O
is	O
a	O
set	O
of	O
observed	O
data	O
values	O
,	O
a	O
model	O
to	O
fit	O
to	O
the	O
observations	O
,	O
and	O
some	O
confidence	O
parameters	O
defining	O
outliers	O
.	O
</s>
<s>
In	O
more	O
details	O
than	O
the	O
aforementioned	O
RANSAC	B-Algorithm
algorithm	O
overview	O
,	O
RANSAC	B-Algorithm
achieves	O
its	O
goal	O
by	O
repeating	O
the	O
following	O
steps	O
:	O
</s>
<s>
The	O
generic	O
RANSAC	B-Algorithm
algorithm	O
works	O
as	O
the	O
following	O
pseudocode	B-Language
:	O
</s>
<s>
A	O
Python	O
implementation	O
mirroring	O
the	O
pseudocode	B-Language
.	O
</s>
<s>
This	O
also	O
defines	O
a	O
LinearRegressor	O
based	O
on	O
least	O
squares	O
,	O
applies	O
RANSAC	B-Algorithm
to	O
a	O
2D	O
regression	O
problem	O
,	O
and	O
visualizes	O
the	O
outcome	O
:	O
</s>
<s>
Let	O
be	O
the	O
desired	O
probability	O
that	O
the	O
RANSAC	B-Algorithm
algorithm	O
provides	O
at	O
least	O
one	O
useful	O
result	O
after	O
running	O
.	O
</s>
<s>
In	O
extreme	O
(	O
for	O
simplifying	O
the	O
derivation	O
)	O
,	O
RANSAC	B-Algorithm
returns	O
a	O
successful	O
result	O
if	O
in	O
some	O
iteration	O
it	O
selects	O
only	O
inliers	O
from	O
the	O
input	O
data	O
set	O
when	O
it	O
chooses	O
points	O
from	O
the	O
data	O
set	O
from	O
which	O
the	O
model	O
parameters	O
are	O
estimated	O
.	O
</s>
<s>
A	O
common	O
case	O
is	O
that	O
is	O
not	O
well	O
known	O
beforehand	O
because	O
of	O
an	O
unknown	O
number	O
of	O
inliers	O
in	O
data	O
before	O
running	O
the	O
RANSAC	B-Algorithm
algorithm	O
,	O
but	O
some	O
rough	O
value	O
can	O
be	O
given	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
case	O
of	O
finding	O
a	O
line	O
which	O
fits	O
the	O
data	O
set	O
illustrated	O
in	O
the	O
above	O
figure	O
,	O
the	O
RANSAC	B-Algorithm
algorithm	O
typically	O
chooses	O
two	O
points	O
in	O
each	O
iteration	O
and	O
computes	O
maybe_model	O
as	O
the	O
line	O
between	O
the	O
points	O
and	O
it	O
is	O
then	O
critical	O
that	O
the	O
two	O
points	O
are	O
distinct	O
.	O
</s>
<s>
To	O
gain	O
additional	O
confidence	O
,	O
the	O
standard	B-General_Concept
deviation	I-General_Concept
or	O
multiples	O
thereof	O
can	O
be	O
added	O
to	O
.	O
</s>
<s>
An	O
advantage	O
of	O
RANSAC	B-Algorithm
is	O
its	O
ability	O
to	O
do	O
robust	O
estimation	O
of	O
the	O
model	O
parameters	O
,	O
i.e.	O
,	O
it	O
can	O
estimate	O
the	O
parameters	O
with	O
a	O
high	O
degree	O
of	O
accuracy	O
even	O
when	O
a	O
significant	O
number	O
of	O
outliers	O
are	O
present	O
in	O
the	O
data	O
set	O
.	O
</s>
<s>
A	O
disadvantage	O
of	O
RANSAC	B-Algorithm
is	O
that	O
there	O
is	O
no	O
upper	O
bound	O
on	O
the	O
time	O
it	O
takes	O
to	O
compute	O
these	O
parameters	O
(	O
except	O
exhaustion	O
)	O
.	O
</s>
<s>
In	O
this	O
way	O
RANSAC	B-Algorithm
offers	O
a	O
trade-off	O
;	O
by	O
computing	O
a	O
greater	O
number	O
of	O
iterations	O
the	O
probability	O
of	O
a	O
reasonable	O
model	O
being	O
produced	O
is	O
increased	O
.	O
</s>
<s>
Moreover	O
,	O
RANSAC	B-Algorithm
is	O
not	O
always	O
able	O
to	O
find	O
the	O
optimal	O
set	O
even	O
for	O
moderately	O
contaminated	O
sets	O
and	O
it	O
usually	O
performs	O
badly	O
when	O
the	O
number	O
of	O
inliers	O
is	O
less	O
than	O
50%	O
.	O
</s>
<s>
Optimal	O
RANSAC	B-Algorithm
was	O
proposed	O
to	O
handle	O
both	O
these	O
problems	O
and	O
is	O
capable	O
of	O
finding	O
the	O
optimal	O
set	O
for	O
heavily	O
contaminated	O
sets	O
,	O
even	O
for	O
an	O
inlier	O
ratio	O
under	O
5%	O
.	O
</s>
<s>
Another	O
disadvantage	O
of	O
RANSAC	B-Algorithm
is	O
that	O
it	O
requires	O
the	O
setting	O
of	O
problem-specific	O
thresholds	O
.	O
</s>
<s>
RANSAC	B-Algorithm
can	O
only	O
estimate	O
one	O
model	O
for	O
a	O
particular	O
data	O
set	O
.	O
</s>
<s>
As	O
for	O
any	O
one-model	O
approach	O
when	O
two	O
(	O
or	O
more	O
)	O
model	O
instances	O
exist	O
,	O
RANSAC	B-Algorithm
may	O
fail	O
to	O
find	O
either	O
one	O
.	O
</s>
<s>
The	O
Hough	B-Algorithm
transform	I-Algorithm
is	O
one	O
alternative	O
robust	O
estimation	O
technique	O
that	O
may	O
be	O
useful	O
when	O
more	O
than	O
one	O
model	O
instance	O
is	O
present	O
.	O
</s>
<s>
Another	O
approach	O
for	O
multi	O
model	O
fitting	O
is	O
known	O
as	O
PEARL	O
,	O
which	O
combines	O
model	O
sampling	O
from	O
data	O
points	O
as	O
in	O
RANSAC	B-Algorithm
with	O
iterative	O
re-estimation	O
of	O
inliers	O
and	O
the	O
multi-model	O
fitting	O
being	O
formulated	O
as	O
an	O
optimization	O
problem	O
with	O
a	O
global	O
energy	O
function	O
describing	O
the	O
quality	O
of	O
the	O
overall	O
solution	O
.	O
</s>
<s>
The	O
RANSAC	B-Algorithm
algorithm	O
is	O
often	O
used	O
in	O
computer	B-Application
vision	I-Application
,	O
e.g.	O
,	O
to	O
simultaneously	O
solve	O
the	O
correspondence	B-Algorithm
problem	I-Algorithm
and	O
estimate	O
the	O
fundamental	B-General_Concept
matrix	I-General_Concept
related	O
to	O
a	O
pair	O
of	O
stereo	O
cameras	O
;	O
see	O
also	O
:	O
Structure	B-Algorithm
from	I-Algorithm
motion	I-Algorithm
,	O
scale-invariant	B-Algorithm
feature	I-Algorithm
transform	I-Algorithm
,	O
image	B-Algorithm
stitching	I-Algorithm
,	O
rigid	B-Algorithm
motion	I-Algorithm
segmentation	I-Algorithm
.	O
</s>
<s>
Since	O
1981	O
RANSAC	B-Algorithm
has	O
become	O
a	O
fundamental	O
tool	O
in	O
the	O
computer	B-Application
vision	I-Application
and	O
image	O
processing	O
community	O
.	O
</s>
<s>
In	O
2006	O
,	O
for	O
the	O
25th	O
anniversary	O
of	O
the	O
algorithm	O
,	O
a	O
workshop	O
was	O
organized	O
at	O
the	O
International	O
Conference	O
on	O
Computer	B-Application
Vision	I-Application
and	O
Pattern	O
Recognition	O
(	O
CVPR	O
)	O
to	O
summarize	O
the	O
most	O
recent	O
contributions	O
and	O
variations	O
to	O
the	O
original	O
algorithm	O
,	O
mostly	O
meant	O
to	O
improve	O
the	O
speed	O
of	O
the	O
algorithm	O
,	O
the	O
robustness	O
and	O
accuracy	O
of	O
the	O
estimated	O
solution	O
and	O
to	O
decrease	O
the	O
dependency	O
from	O
user	O
defined	O
constants	O
.	O
</s>
<s>
RANSAC	B-Algorithm
can	O
be	O
sensitive	O
to	O
the	O
choice	O
of	O
the	O
correct	O
noise	O
threshold	O
that	O
defines	O
which	O
data	O
points	O
fit	O
a	O
model	O
instantiated	O
with	O
a	O
certain	O
set	O
of	O
parameters	O
.	O
</s>
<s>
proposed	O
two	O
modification	O
of	O
RANSAC	B-Algorithm
called	O
MSAC	O
(	O
M-estimator	O
SAmple	O
and	O
Consensus	O
)	O
and	O
MLESAC	O
(	O
Maximum	O
Likelihood	O
Estimation	O
SAmple	O
and	O
Consensus	O
)	O
.	O
</s>
<s>
also	O
proposed	O
a	O
randomized	O
version	O
of	O
RANSAC	B-Algorithm
called	O
R-RANSAC	O
to	O
reduce	O
the	O
computational	O
burden	O
to	O
identify	O
a	O
good	O
consensus	O
set	O
.	O
</s>
<s>
Nistér	O
proposed	O
a	O
paradigm	O
called	O
Preemptive	O
RANSAC	B-Algorithm
that	O
allows	O
real	O
time	O
robust	O
estimation	O
of	O
the	O
structure	O
of	O
a	O
scene	O
and	O
of	O
the	O
motion	O
of	O
the	O
camera	O
.	O
</s>
<s>
RANSAC	B-Algorithm
has	O
also	O
been	O
tailored	O
for	O
recursive	O
state	O
estimation	O
applications	O
,	O
where	O
the	O
input	O
measurements	O
are	O
corrupted	O
by	O
outliers	O
and	O
Kalman	O
filter	O
approaches	O
,	O
which	O
rely	O
on	O
a	O
Gaussian	O
distribution	O
of	O
the	O
measurement	O
error	O
,	O
are	O
doomed	O
to	O
fail	O
.	O
</s>
<s>
Hop-Diffusion	O
Monte	O
Carlo	O
uses	O
randomized	O
sampling	O
involve	O
global	O
jumps	O
and	O
local	O
diffusion	O
to	O
choose	O
the	O
sample	O
at	O
each	O
step	O
of	O
RANSAC	B-Algorithm
for	O
epipolar	O
geometry	O
estimation	O
between	O
very	O
wide-baseline	O
images	O
.	O
</s>
