Skip to main content
. 2015 Feb 2;15(2):3172–3203. doi: 10.3390/s150203172

Algorithm 3: Adding tolerance points.

begin
 vectorLength(point A; point B) ← length of the vector connecting the point A to the point B
 PtEnd ← last point of the segment
 Pt5BeforeEnd ← 5th before PtEnd
 PtsCandidates ← retrieve all edge points around the last point PtEnd
 PtNext ← Choose the best point among PtsCandidates using Algorithm 1
 scalarProduct ← scalar product [Pt5BeforeEnd ; PtEnd] with [PtEnd ; PtNext]
if (scalarProduct > 0) then
  Add the point PtNext as a tolerance point