Skip to main content
. Author manuscript; available in PMC: 2018 Oct 1.
Published in final edited form as: IEEE Trans Image Process. 2017 Jul 3;26(10):4900–4910. doi: 10.1109/TIP.2017.2722689

Algorithm 1 Fitting a function via RANSAC

Let f : ℝn → ℝn be the function we wish to fit. Furthermore, let S={(xk,yk)}k=1m, such that xk ∈ ℝn corresponds to yk ∈ ℝn. N and ε are parameters.
I* ← ø
for i = 1, …, N do
 Fit f to a randomly drawn subset of S
I ← {(x, y) ∈ S : ‖f(x) – y‖ < ε}
if |I| > |I*| then
  I* ← I
end if
end for
Fit f to I*