Skip to main content
. 2019 Jan 21;19(2):427. doi: 10.3390/s19020427
Algorithm 1: Estimate and optimize the corresponding points.
input: ModelS and DataT with normals of size N×6 (N is the scale of Model/Data)
output:  2 pairs of corresponding points P1S, P2S, P1T and P2T
1 extract normals NS and NT from S and T
2 HSH(NS); HTH(NT); // see Equations (7) & (8)
3 fori1to 12 do
4 HS(i),IS(i)max(HiS); // maximum intensity and the index
5 HT(i),IT(i)max(HiT)
6 NS(i)IS(i); NT(i)IT(i); // normals of the max
7 PiSP(NS(i)); PiTP(NT(i)); // see Equation (6)
8  construct Struct Q(i)={H(i),I(i),Pi}
9 end for
10 QSsortrows (HS; QT) sortrows (HT); // descending sort
11 i=2
12 PtempS=P2S
13 while arccos(ViS,VtempS)>0.94 do // see Eqution (10)
14 PtempS=Pi+1S
15 ii+1
16 end while
17 P2S=PtempS
18 fori2to 12 do
19 PtempT=PiT
20 if d1tempSd1tempT<0.05 then // see Equation (12)
21   P2T=PtempT
22   break;
23 end if
24 end for
25 let n=4 then calculate N1S,N2S,N1T,N2T; // see Equation (13)
26 a,b,c=V1S
27 create e1=(1,1,a+bc) in plane A then e2=e1×V1S
28 N1S=(ei;e2·(N1S)T)T; // project normals to A
29 calculate r1S; // see Equation (14)
30 mesh r1S×r1S region into 100 grids;
31 search (xp,yp) with the peak intensity in meshed grids;
32 calculate inverse projection point P1S
33 calculate P2S, P1T, P2T