1

I have two meshes that I want to align, I'll call the reference mesh the template mesh and the other is the target mesh. I have 1 point-to-point correspondence between my template and target mesh. I am trying to find the uniform scale and translation to align these 2 meshes. This is what I've been doing :

My optimal transformation matrix M = [M11 0 0 M14; 0 M11 0 M24 ; 0 0 M11 M34; 0 0 0 1 ] , here M11 is my scale and M14, M24, M34 are the translation in x,y and z. I represent my points from the template mesh as homogeneous coordinates -> A = [xt, yt, zt, 1] the corresponding points on the target mesh -> B = [xp, yp, zp, 1]

I know that :

xp = M11*xt + M14
yp = M11*xt + M24
zp = M11*xt + M34

This is how I form and solve my least sqauares problem :

findMin((X*T - B)^2) 

Where T, X and B are :

  B  =      X      *   T
  [xp  [ xt 1 0 0    [M11
   yp =  yt 0 1 0  *  M14
   zp    zt 0 0 1     M24
   1]    1  1 1 1]    M34]

This is how I find the least squares fit for T :

(Inverse(X'*X))*X'*B

I am not sure if this is the right way to go about this, particularly

  1. Is it acceptable to add the row of ones in the last row of matrix X in my least sqaures problem? It has no physical meaning, I just added it to make dimensions match and ensure that the matrix X is invertible.
  2. With this I get negative scale values, is there a way I can add constraints in the least squares problem to ensure that I get a scale that is always greater than 0? Is this even the right approach to find a scale value?
Mn9
  • 83
  • 3
  • Probably better to add 0 and only have on 1 on the row. – joojaa Nov 16 '19 at 14:47
  • Also note that the multiplication makes the matrix square. – joojaa Nov 16 '19 at 16:19
  • You should drop the last entry of $B$ and the last row of $X$, since you only have three equations per point pair. Also, I assume you are going to be vertically concatenating the $B$'s and $X$'s obtained from all the point pairs. –  Nov 16 '19 at 18:18
  • P.S. I'm fairly sure the optimal solution is given simply by the translation which aligns the two point sets' centroids, and the scaling which equates the RMS distance from the points to the centroid. See ordinary Procrustes analysis. –  Nov 16 '19 at 18:20
  • @Rahul , I am not sure if I can drop the last entry of B and X, since my T matrix is still a 4X1 matrix. My first doubt is, does it even make sense to estimate scale and translation from just 1 point to point correspondence between 2 objects? Ordinary Procrustes analysis seems promising, and I am actually trying to implement a skeleton fitting algorithm. I'll try that method and get back with the results. – Mn9 Nov 17 '19 at 05:13
  • Oh, I missed the fact that you have only one point-to-point correspondence. Yes, in that case you cannot possibly find both scale and translation. Notice that you can scale one mesh however much you like and still find a translation that exactly aligns the points. –  Nov 17 '19 at 06:03
  • yes, that makes sense to me. I got this question while reading this paper - https://www.cs.utah.edu/~ladislav/saito15computational/saito15computational.pdf. In section 3.4, they say they estimate uniform scale and translation for both ends of the bone, with just one point-to-point correspondence at each end. I was wondering if this was done using a least squares optimiser? Thanks for all the help! – Mn9 Nov 17 '19 at 10:39

0 Answers0