I am trying solving the equation , s m' = A[R|t]M'
i.e
m = K . T . M where m, K, M and last column of T [ R | t ] are known.
I want to obtain the values for each element of the 3*3 rotation matrix. I have.
This question was also answered here
But I could not understand how to get values for 3*3 rotation matrix after making the new set of equations each time, when we take new values for m and M.
m contains the coordinates of the projection point in pixels, I have 16 different points on the image for the pattern captured by the camera and have 16 set of values for each u and v.
m=np.array([u,v,1])
K is my intrinsic matrix/camera matrix/matrix of intrinsic parameters for the camera, I have the value for fx, fy (focal lengths) and cx, cy (principal point) as camera intrinsic matrix
K=np.matrix([ [fx, 0, cx, 0],
[ 0, fy, cy, 0],
[ 0, 0, 1, 0]])
T is the transformation to pass to the "world" coordinate system to the camera coordinate system ( extrinsic matrix,[ R | t ] ), I also have the values for Tx, Ty and Tz.
T= np.matrix([[x00, x01, x02, Tx],
[x10, x11, x12, Ty],
[x20, x21, x22, Tz],
[0 , 0 , 0 , 1 ]])
M is the homogeneous coordinate of a point in the Cartesian coordinate system "world" i.e the coordinates of a 3D point in the world coordinate space. I have the 16 points from the pattern therefore i have 16 different values for each X, Y, Z.
M=np.array([X,Y,Z,1])
My goal is to get the values for elements x00, x01, x02, x10, x11, x12, x20, x21, x22 for matrix T. could someone please help??
For more clarification:
Suppose for m matrix (the coordinates of the projection point in pixels) the value of u and v are:
u = [ 337, 337, 316, 317, 302, 302, 291, 292, 338, ...]
and
v =[ 487, 572, 477, 547, 470, 528, 465, 516, 598, ...]
i.e the coordinates of the first projection point in pixels are 337 (row number) and 487 (column number)
therefore,
for first set of equation, matrix, m will have values,
import sympy as sy
import numpy as np
# m = sy.Matrix([u, v, 1]
m = sy.Matrix([337, 487, 1])
,
for second set of equation, matrix, m will have values,
# m = sy.Matrix([u, v, 1]
m = sy.Matrix([337, 572, 1])
and soon...
for K matrix (matrix of intrinsic parameters) the values:
K = sy.Matrix([[711.629, 0, 496.220, 0],
[0, 712.682, 350.535, 0],
[0, 0, 0, 1]])
for M matrix ( the coordinates of a 3D points in the world coordinate space) the value for X,Y and Z are:
X = [4.25, 4.25, 5.32, 5.32, 6.27, 6.27, 7.28, 7.28, 4.20, ...]
Y = 0
Z = [0.63, 1.63, 0.63, 1.63, 0.59, 1.59, 0.60, 1.92, 2.92, ...]
for first set of equation, matrix M will be
# M=np.array([X,Y,Z,1])
M = sy.Matrix([0.63, 0, 4.25, 1])
,
for second set of equation, matrix, M will have values,
# M=np.array([X,Y,Z,1])
M = sy.Matrix([1.63, 0, 4.25, 1])
and soon...
for T matrix ( extrinsic matrix, [ R | t ]) we have value for Tx, Ty, Tz as 0, -1.35, 0 .Therefore, T matrix will be:
T = sy.Matrix([[x11, x12, x13, 0],
[x21, x22, x23, -1.32],
[x31, x32, x33, 0],
[0, 0, 0, 1]])
I need to make nine set of these matrix equations: m = K * T * M using different value for m and M so that I could calculate the values for 9 unknowns in T matrix out of these set of equations.

