Skip to main content
. 2017 Aug 23;17(9):1932. doi: 10.3390/s17091932
Algorithm 1. Extraction of lines for one segment SS
1: Ls=, c = 0, pl=
% Ls denotes a set of line set in segment S, c denotes count of loop, pl denotes a point of line
2: for j = 0 in MAX_B do  % for each bin
3:  if pbjs then     % if there is a point mapping in bjs
4:   if |pl| >= 2 then   % if the number of points in Ls bigger than two
5:    (mc,bc) = fitline(plpbjs)  % line fit to get mc,bc of L
6:    if |mc| <= Tm ∧ (mc > |Tmsmall| ∨ |bc| <= Tb) ∧ fitError(mc,bc,plpbjs) < TRMSE then
     % if match condition of thresholds
7:       plplpbjs      % add pbjs to pl
8:    else
9:       (mc,bc) fitline (pl)    % line fit to get mc,bc of L
10:      LsLs{(mc,bc)}
11:      pl           % clear pl
12:      c  c + 1        % next line segment
13:      j  j − 1         % next distance
14:   else               % if the number of points in Ls smaller than two
15:    if c = 0 ∨ (pl) ∨ distpointline(pbjs,mc1,bc1)Tdprev then
     % if the first point or the distance of point and line match thresholds
16:      pl=plpbjs        % add pbjs to pl