Skip to main content
. 2022 Sep 29;13:947690. doi: 10.3389/fpls.2022.947690

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 pPleaf do
         if (ypyroot)(yfyroot) − (xpxroot)(xfxroot) > 0 then
    Plp ;
4:       else Prp ;
         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:    Pnextns p with the shortest distance to proot,
    pPc ;
        while Pnext ≠ ∅ do
16:         pcurrent = p(min(p, line(proot, p(f))), pPnext) ;
           Pholepcurrent ;
18:         Pnext = ∅ ;
           for all p such that |p, proot| > |pcurrent, proot|,
     |p, pcurrent| < r, pPc do Pnextp ;
20:         end for
    end while
22:     for all p such that pPhole do Uniformly
    sampled ground between p and the point of
    symmetry of p ;
    end for
24:         return result
    end function