Skip to main content
. 2014 Jul 29;14(8):13708–13729. doi: 10.3390/s140813708

Algorithm 1 The algorithm to find edge lines at orthogonal plane intersections within the point cloud.

EdgeExtraction(M)
Input:
M : Point cloud.
Output:
E: 3D lines.
1: D ← ø
2: for each piM do
3: Ni ← FindNeighbors(pi, M)
4: ni ← ComputeNormal(pi, Ni)
5:  Label(pi) ← i
6: DD ⋃ FindDistances(pi, Ni)
7: end for
8: D ← SortDistances(D)
9: for each dkD do
10: ci ← Start(dk)
11: cj ← End(dk)
12: if Label(ci) ≠ Label(cj) then
13:   if |cos1(niTnj)|<tc then
14:     if ki|(cicj)Tnj|+kj|(cjci)Tni|ki+kj<td then
15:     MergeTrees(ci, cj)
16:    end if
17:   end if
18: end if
19: end for
20: E ← ø
21: L ← Labels(M)
22: for each pair of segments (si, sj) ∈ L with respective (ni, nj) do
23: if Orthogonal(ni, nj) then
24:   EE ⋃ PlaneIntersection(ni, nj)
25: end if
26: end for