|
|
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 pi ∈ M
do
|
| 3: |
Ni ← FindNeighbors(pi, M) |
| 4: |
ni ← ComputeNormal(pi, Ni) |
| 5: |
Label(pi) ← i
|
| 6: |
D ← D ⋃ FindDistances(pi, Ni) |
| 7: |
end for |
| 8: |
D ← SortDistances(D) |
| 9: |
for each dk ∈ D
do
|
| 10: |
ci ← Start(dk) |
| 11: |
cj ← End(dk) |
| 12: |
if Label(ci) ≠ Label(cj) then
|
| 13: |
if
then
|
| 14: |
if
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: |
E ← E ⋃ PlaneIntersection(ni, nj) |
| 25: |
end if
|
| 26: |
end for |
|