0

I have two matrices, one containing 3D coordinates that are nominal positions per a CAD model and the other containing 3D coordinates of actual measured positions using a CMM. Every nominal point has a corresponding measurement, or in other words the two matrices are of equal length and width. I'm not sure what the best way is to fit the measured points to the nominal points. I need a way of calculating the translation and rotation to apply to all of the measured points that produce the minimum distance between each nominal/measured pair of points while not exceeding allowed tolerances on maximum distance at any other point. This is similar to Registration of point clouds but different in that each pair of nominal/measured points has a unique tolerance/limit on how far apart they are allowed to be. That limit is higher for some pairs and lower for others. I'm programming in .Net and have looked into Point Cloud Library (PCL), OpenCV, Excel, and basic matrix operations as possible approaches. This is a sample of the data

X Nom    Y Nom  Z Nom   X Meas  Y Meas  Z Meas  Upper Tol   Lower Tol
118.81  2.24    -14.14  118.68  2.24    -14.14  1.00    -0.50
118.72  1.71    -17.19  118.52  1.70    -17.16  1.00    -0.50
115.36  1.53    -24.19  115.14  1.52    -23.98  0.50    -0.50
108.73  1.20    -27.75  108.66  1.20    -27.41  0.20    -0.20

Below is the type of matrix I need to calculate in order to best fit the measured points to the nominal points. I will multiply it by the measured point matrix to best fit to the nominal point matrix.

    Transformation  
0.999897324 -0.000587540    0.014317661
0.000632725 0.999994834 -0.003151567
-0.014315736    0.003160302 0.999892530
-0.000990993    0.001672040 0.001672040
  • I'm actually quite curious for which application you're going to use this... – Deepfreeze Apr 09 '14 at 16:07
  • @Deepfreeze Personally using this for vision-based Quality Control. First, we create a transform to match reference/alignment points (the problem described in this post). Then, we perform feature matching to ensure that a part conforms to spec. – Mateen Ulhaq Apr 08 '16 at 17:14

1 Answers1

0

This is indeed a job for a rigid registration algorithm.

In order to handle your tolerances you have a couple of options:

  • Simple option: Run rigid registration, check afterwards if result is within tolerances
  • Bit harder option: Offset your points in the CAD, where you have imbalanced tolerances the rest the same as the previous option.
  • Hardest option: What you probably want to do is and have the offset as in the second option, and also add a weight function based on measured position and set tolerance. This weight function should effect the energy function in such a way, that the individual function vectors are larger when you have a small tolerance and smaller when you have a larger tolerence.

So now about implementation, for options 1 and 2 your fastest way to result would probably be:

If your really want option 3 you can do:

  • Make the weight function in PCL library source code and compile it
  • Make the complete ICP algorithm yourself in .net:
    • http://www.math.tau.ac.il/~dcor/Graphics/adv-slides/ICP.ppt
    • Use math.numerics sparse matrix/vector algebra and solvers to create your own optimizer
    • Realize the Lev-Marq or Gauss-Newton optimizer from:
      imm methods for non-linear least squares problems, K. Madsen, 2004
    • Generate your own function vector and jacobian matrix (with weight function)
    • Have quite some patience to get is all to work together :)
    • Post the result for the others on StackOverflow that are waiting for ICP in C# .net
Community
  • 1
  • 1
Deepfreeze
  • 1,755
  • 1
  • 13
  • 18