Skip to main content
. 2008 Nov 17;8(11):7323–7343. doi: 10.3390/s8117323

Algorithm 2: Pseudo code of the segmentation algorithm

Input: Pxyz (points), Pfsp (feature space parameter of points), thos (distance threshold in object space)
Output: Pid (plane segment index per point), (a, b, c, d) (plane parameter)
1 repeat
2 PSCxyz =Algorithm 1(Pxyz)
3 scpl = nspl = regression plane(PSCxyz)
4 repeat
5    pnewseg={PSCxyzi:normDist(PSCxyzi,scpl)<thos}
6   determine d(Pnewseg, scpl)∀Pnewseg (cf. Eq. 5)
7    pnewseg=Pnewseg\{Pnewsegi:di<thfs}
8   nspl (new segment plane) = regression plane(Pnewseg)
9   PSCxyz = {P: Pnewsegnspl}
10 until scpl = nspl
11 Pidi=new plane idPxyzPnewseg
12 Pxyz=Pxyz \ Pnewseg
13 until new(sc) = ∅
14 ifdisjunct sub-segments in a segment then split segment
15 ifsimilar and touching segments then merge segments