Inverting a 4x4 rotate and translation matrix
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have two OpenCV cv::Mat
s that represent rotates and transforms of cameras facing forwards and backwards. The matrices represent where the camera points to in 3D space (excuse the very crude rounding):
cv::Mat rear2World = [[-1, -0.004 -0.01, 3.56],
[0.006, 0.58, -0.8, -6.9],
[0.01, -0.81, -0.59, 0.8],
[0, 0, 0, 1]];
cv::Mat front2World = [[1, 0.007, 0, 3.5],
[0.001, -0.25, 0.97, -2.4],
[0.008, -1, -0.25, 0.49],
[0, 0, 0, 1]];
So, according to my understanding, to get a transformation matrix for front2Rear
, I should just do:
cv::Mat front2Rear = front2World * rear2World.inv();
However, I get a result like:
cv::Mat front2Rear = [[-1, 0.01, 0.003, 7.22],
[-0.01, -0.93, -0.36, -8.5],
[0, -0.36, 0.933, -2.76],
[0, 0, 0, 1]];
I was expecting to get the last column to be equal [0.06, -4.5, 0.31] or so, but I'm probably got some fundamental understanding wrong! Can someone point me in the right direction, please.
matrices programming
add a comment |Â
up vote
0
down vote
favorite
I have two OpenCV cv::Mat
s that represent rotates and transforms of cameras facing forwards and backwards. The matrices represent where the camera points to in 3D space (excuse the very crude rounding):
cv::Mat rear2World = [[-1, -0.004 -0.01, 3.56],
[0.006, 0.58, -0.8, -6.9],
[0.01, -0.81, -0.59, 0.8],
[0, 0, 0, 1]];
cv::Mat front2World = [[1, 0.007, 0, 3.5],
[0.001, -0.25, 0.97, -2.4],
[0.008, -1, -0.25, 0.49],
[0, 0, 0, 1]];
So, according to my understanding, to get a transformation matrix for front2Rear
, I should just do:
cv::Mat front2Rear = front2World * rear2World.inv();
However, I get a result like:
cv::Mat front2Rear = [[-1, 0.01, 0.003, 7.22],
[-0.01, -0.93, -0.36, -8.5],
[0, -0.36, 0.933, -2.76],
[0, 0, 0, 1]];
I was expecting to get the last column to be equal [0.06, -4.5, 0.31] or so, but I'm probably got some fundamental understanding wrong! Can someone point me in the right direction, please.
matrices programming
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have two OpenCV cv::Mat
s that represent rotates and transforms of cameras facing forwards and backwards. The matrices represent where the camera points to in 3D space (excuse the very crude rounding):
cv::Mat rear2World = [[-1, -0.004 -0.01, 3.56],
[0.006, 0.58, -0.8, -6.9],
[0.01, -0.81, -0.59, 0.8],
[0, 0, 0, 1]];
cv::Mat front2World = [[1, 0.007, 0, 3.5],
[0.001, -0.25, 0.97, -2.4],
[0.008, -1, -0.25, 0.49],
[0, 0, 0, 1]];
So, according to my understanding, to get a transformation matrix for front2Rear
, I should just do:
cv::Mat front2Rear = front2World * rear2World.inv();
However, I get a result like:
cv::Mat front2Rear = [[-1, 0.01, 0.003, 7.22],
[-0.01, -0.93, -0.36, -8.5],
[0, -0.36, 0.933, -2.76],
[0, 0, 0, 1]];
I was expecting to get the last column to be equal [0.06, -4.5, 0.31] or so, but I'm probably got some fundamental understanding wrong! Can someone point me in the right direction, please.
matrices programming
I have two OpenCV cv::Mat
s that represent rotates and transforms of cameras facing forwards and backwards. The matrices represent where the camera points to in 3D space (excuse the very crude rounding):
cv::Mat rear2World = [[-1, -0.004 -0.01, 3.56],
[0.006, 0.58, -0.8, -6.9],
[0.01, -0.81, -0.59, 0.8],
[0, 0, 0, 1]];
cv::Mat front2World = [[1, 0.007, 0, 3.5],
[0.001, -0.25, 0.97, -2.4],
[0.008, -1, -0.25, 0.49],
[0, 0, 0, 1]];
So, according to my understanding, to get a transformation matrix for front2Rear
, I should just do:
cv::Mat front2Rear = front2World * rear2World.inv();
However, I get a result like:
cv::Mat front2Rear = [[-1, 0.01, 0.003, 7.22],
[-0.01, -0.93, -0.36, -8.5],
[0, -0.36, 0.933, -2.76],
[0, 0, 0, 1]];
I was expecting to get the last column to be equal [0.06, -4.5, 0.31] or so, but I'm probably got some fundamental understanding wrong! Can someone point me in the right direction, please.
matrices programming
asked Jul 27 at 7:46


Ken Y-N
1013
1013
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2864154%2finverting-a-4x4-rotate-and-translation-matrix%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password