Algorithm 2 Improved slope-constrained RANSAC algorithm with early termination |
Require: Current frame laser stripe point set P, previous slope ,
|
1: max iterations K, distance threshold ,
|
2: slope tolerance , consecutive patience N
|
Ensure: Optimal line model , inlier set
|
3: Initialize best inliers:
|
4: Initialize optimal model:
|
5: Iteration counter:
|
6: No improvement counter:
|
7: while
and
do
|
8:
|
9: repeat
|
10: Randomly select two distinct points
|
11: Compute slope:
|
12: until
|
13: Construct line model:
|
14: Temporary inlier set:
|
15: for each point do
|
16: Distance:
|
17: if then
|
18:
|
19: end if
|
20: end for
|
21: if then
|
22:
|
23:
|
24:
|
25: else
|
26:
|
27: end if
|
28: end while
|
29: return
|