| Algorithm 1 Pseudo code for RANSAC Algorithm (Code Listing 1: RANSAC algorithm) |
| 1 Input: point set A = {ai | i = 1,...,p} |
| 2 Output: planes Pj = {pjk |k = 1,...,Q}: for j = 1,...,J |
| 3 j = 1; |
| 4 while (!area(B) < A){ |
| 5 m = 1; |
| 6 B = RANSAC Plane_Fitiing (A); |
| 7 C = Normal_Coherence_Check (B); |
| 8 D = Find_Largest-Patch (C); |
| 9 P = Patch_Number (C); |
| 10 if (area(D) = ?){ |
| 11 A = A − C; |
| 12 else{ |
| 13 while (area(D) > ? and m < M){ |
| 14 F = Iterative_Plane_Clustering (A,D); |
| 15 Pj = Find_Largest_Patch (F); |
| 16 A = A − Pj; C = C − D; |
| 17 D = Find _Largest_Patch (C); |
| 18 j = j + 1 ; m = m + 1; |
| 19 } |
| 20 } |
| 21 } |