Algorithm 1.
Leaf point cloud completion.
INPUT:
Pleaf - Leaf point cloud pf - Leaf tip point proot - Root point OUTPUT: Pcomplete - completed leaf point cloud |
function symmetry(Pleaf, pf, proot) |
2: for all p such that p ∈ Pleaf do |
if (yp − yroot)(yf − yroot) − (xp − xroot)(xf − xroot) > 0 then Pl ← p ; |
4: else Pr ← p ; |
end if |
6: end for |
δ = 2 × (|Pl| − |Pr|)/(|Pl| + |Pr|) ; |
8: if δ > μ then Pc = Pl ; |
else if δ < −μ then Pc = Pr ; |
10: else return Pleaf ; |
end if |
12: Ps ← points obtained by symmetrizing Pc according to the line pf and proot ; |
Pleaf = Pleaf + Ps ; |
14: Pnext ← ns
p with the shortest distance to proot, p ∈ Pc ; |
while Pnext ≠ ∅ do |
16: pcurrent = p(min(p, line(proot, p(f))), p ∈ Pnext) ; |
Phole ← pcurrent ; |
18: Pnext = ∅ ; |
for all
p such that |p, proot| > |pcurrent, proot|, |p, pcurrent| < r, p ∈ Pc do Pnext←p ; |
20: end for |
end while |
22: for all
p such that p ∈ Phole
do Uniformly sampled ground between p and the point of symmetry of p ; |
end for |
24: return result |
end function |