Skip to main content
. 2024 Apr 24;24(9):2703. doi: 10.3390/s24092703
Algorithm 1 Point set registration algorithm
  •   1:

     Input: reference point set PRn×3; measured point set QRm×3; maximum accepted deviation σ of Euclidean point distances

  •   2:

     Output: rotation matrix RR3×3, translation vector tR3 representing the rigid transformation from the camera coordinate system to the sample coordinate system

  •   3:

     

  •   4:

     Compute distance matrices DPRn×n, DQRm×m; dp,k,lDP corresponds to the Euclidean distance between the points pk, plP and dq,i,jDQ to the distance between qi, qjQ;

  •   5:

     

     ▹ Identify candidate points that could be a match:

  •   6:

     Initialize empty list candidates[qi] for candidate points from P that could be a match for the points qi from Q; only unique points, no double entries;

  •   7:

     for each point qi in Q do

  •   8:

           for each dp,k,l with k<l do

  •   9:

                 if |dq,i,i+1dp,k,l|<σ then

  • 10:

                      Add pk,pl to the list candidates[qi]

  • 11:

                      Add pk,pl to the list candidates[qi+1]

  • 12:

                 end if

  • 13:

           end for

  • 14:

     end for

  • 15:

     

     ▹ Find all matches with candidate points:

  • 16:

     matches[q,p]Rm×n contains number of matching edges for points qQ and pP

  • 17:

     Initialize matches with zeros

  • 18:

     for each dq,i,j do

  • 19:

           for each dp,k,l with pk in candidates[qi] do

  • 20:

                 if |dq,i,jdp,k,l| <σ then

  • 21:

                      matches[qi,pk]=matches[qi,pk]+1

  • 22:

                      Continue with next pk

  • 23:

                 end if

  • 24:

           end for

  • 25:

     end for

  • 26:

     

  • 27:

     qiQ and pkP with the highest values in matches[q,p] are matched together

  • 28:

     Get RR3×3, tR3 with Kabsch algorithm

  • 29:

     Fine tuning: remove the point pair with the highest distance after registration and check if the overall registration quality improves

  • 30:

     

  • 31:

     return R,t