Solving for a matrix using least squares
$begingroup$
I am trying to understand equation 26 given equation 25.
I know that generally, if we have an overdetermined system of linear equations of the form
$Ax = b$
the least squares solution is
$hat{x} = (A^TA)^{-1}A^Tb$
Applying it to the above equation of
$D [R|t] = C$
where $[R|t]$ is the unknown matrix, we get
$hat{[R|t]} = (D^TD)^{-1}D^TC$
but that's not exactly what's shown in equation 26. How did (26) come from (25) if they are "solving linearly"?
K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
Thanks!
linear-algebra
$endgroup$
add a comment |
$begingroup$
I am trying to understand equation 26 given equation 25.
I know that generally, if we have an overdetermined system of linear equations of the form
$Ax = b$
the least squares solution is
$hat{x} = (A^TA)^{-1}A^Tb$
Applying it to the above equation of
$D [R|t] = C$
where $[R|t]$ is the unknown matrix, we get
$hat{[R|t]} = (D^TD)^{-1}D^TC$
but that's not exactly what's shown in equation 26. How did (26) come from (25) if they are "solving linearly"?
K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
Thanks!
linear-algebra
$endgroup$
$begingroup$
Can you define what $K$, $R$, and $t$ are?
$endgroup$
– Wolfy
Dec 20 '18 at 6:34
$begingroup$
Yes, sorry. K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
$endgroup$
– Carpetfizz
Dec 20 '18 at 6:35
$begingroup$
Okay, please edit your question, so other people know as well :).
$endgroup$
– Wolfy
Dec 20 '18 at 6:36
$begingroup$
These are two forms of the pseudo inverse matrix. We select one or the other depending on the dimensions of $D$, when $D$ is not square. When $D$ is square and full rank, no difference. An easy demonstration if $D$ is square: consider SVD ...
$endgroup$
– Damien
Dec 20 '18 at 9:12
$begingroup$
A precision: if $D$ is not square, one of the two forms is invalid ...
$endgroup$
– Damien
Dec 20 '18 at 9:15
add a comment |
$begingroup$
I am trying to understand equation 26 given equation 25.
I know that generally, if we have an overdetermined system of linear equations of the form
$Ax = b$
the least squares solution is
$hat{x} = (A^TA)^{-1}A^Tb$
Applying it to the above equation of
$D [R|t] = C$
where $[R|t]$ is the unknown matrix, we get
$hat{[R|t]} = (D^TD)^{-1}D^TC$
but that's not exactly what's shown in equation 26. How did (26) come from (25) if they are "solving linearly"?
K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
Thanks!
linear-algebra
$endgroup$
I am trying to understand equation 26 given equation 25.
I know that generally, if we have an overdetermined system of linear equations of the form
$Ax = b$
the least squares solution is
$hat{x} = (A^TA)^{-1}A^Tb$
Applying it to the above equation of
$D [R|t] = C$
where $[R|t]$ is the unknown matrix, we get
$hat{[R|t]} = (D^TD)^{-1}D^TC$
but that's not exactly what's shown in equation 26. How did (26) come from (25) if they are "solving linearly"?
K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
Thanks!
linear-algebra
linear-algebra
edited Dec 20 '18 at 6:37
Carpetfizz
asked Dec 20 '18 at 6:17
CarpetfizzCarpetfizz
486313
486313
$begingroup$
Can you define what $K$, $R$, and $t$ are?
$endgroup$
– Wolfy
Dec 20 '18 at 6:34
$begingroup$
Yes, sorry. K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
$endgroup$
– Carpetfizz
Dec 20 '18 at 6:35
$begingroup$
Okay, please edit your question, so other people know as well :).
$endgroup$
– Wolfy
Dec 20 '18 at 6:36
$begingroup$
These are two forms of the pseudo inverse matrix. We select one or the other depending on the dimensions of $D$, when $D$ is not square. When $D$ is square and full rank, no difference. An easy demonstration if $D$ is square: consider SVD ...
$endgroup$
– Damien
Dec 20 '18 at 9:12
$begingroup$
A precision: if $D$ is not square, one of the two forms is invalid ...
$endgroup$
– Damien
Dec 20 '18 at 9:15
add a comment |
$begingroup$
Can you define what $K$, $R$, and $t$ are?
$endgroup$
– Wolfy
Dec 20 '18 at 6:34
$begingroup$
Yes, sorry. K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
$endgroup$
– Carpetfizz
Dec 20 '18 at 6:35
$begingroup$
Okay, please edit your question, so other people know as well :).
$endgroup$
– Wolfy
Dec 20 '18 at 6:36
$begingroup$
These are two forms of the pseudo inverse matrix. We select one or the other depending on the dimensions of $D$, when $D$ is not square. When $D$ is square and full rank, no difference. An easy demonstration if $D$ is square: consider SVD ...
$endgroup$
– Damien
Dec 20 '18 at 9:12
$begingroup$
A precision: if $D$ is not square, one of the two forms is invalid ...
$endgroup$
– Damien
Dec 20 '18 at 9:15
$begingroup$
Can you define what $K$, $R$, and $t$ are?
$endgroup$
– Wolfy
Dec 20 '18 at 6:34
$begingroup$
Can you define what $K$, $R$, and $t$ are?
$endgroup$
– Wolfy
Dec 20 '18 at 6:34
$begingroup$
Yes, sorry. K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
$endgroup$
– Carpetfizz
Dec 20 '18 at 6:35
$begingroup$
Yes, sorry. K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
$endgroup$
– Carpetfizz
Dec 20 '18 at 6:35
$begingroup$
Okay, please edit your question, so other people know as well :).
$endgroup$
– Wolfy
Dec 20 '18 at 6:36
$begingroup$
Okay, please edit your question, so other people know as well :).
$endgroup$
– Wolfy
Dec 20 '18 at 6:36
$begingroup$
These are two forms of the pseudo inverse matrix. We select one or the other depending on the dimensions of $D$, when $D$ is not square. When $D$ is square and full rank, no difference. An easy demonstration if $D$ is square: consider SVD ...
$endgroup$
– Damien
Dec 20 '18 at 9:12
$begingroup$
These are two forms of the pseudo inverse matrix. We select one or the other depending on the dimensions of $D$, when $D$ is not square. When $D$ is square and full rank, no difference. An easy demonstration if $D$ is square: consider SVD ...
$endgroup$
– Damien
Dec 20 '18 at 9:12
$begingroup$
A precision: if $D$ is not square, one of the two forms is invalid ...
$endgroup$
– Damien
Dec 20 '18 at 9:15
$begingroup$
A precision: if $D$ is not square, one of the two forms is invalid ...
$endgroup$
– Damien
Dec 20 '18 at 9:15
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
In fact, equation 25 is $ [R|t] D = C$ and not $D [R|t] = C$ , and indeed $ [R|t] DD^T = CD^T$ , yielding $hat{[R|t]}= CD^T*(DD^T)^{-1}$
$endgroup$
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
1
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3047227%2fsolving-for-a-matrix-using-least-squares%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
In fact, equation 25 is $ [R|t] D = C$ and not $D [R|t] = C$ , and indeed $ [R|t] DD^T = CD^T$ , yielding $hat{[R|t]}= CD^T*(DD^T)^{-1}$
$endgroup$
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
1
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
add a comment |
$begingroup$
In fact, equation 25 is $ [R|t] D = C$ and not $D [R|t] = C$ , and indeed $ [R|t] DD^T = CD^T$ , yielding $hat{[R|t]}= CD^T*(DD^T)^{-1}$
$endgroup$
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
1
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
add a comment |
$begingroup$
In fact, equation 25 is $ [R|t] D = C$ and not $D [R|t] = C$ , and indeed $ [R|t] DD^T = CD^T$ , yielding $hat{[R|t]}= CD^T*(DD^T)^{-1}$
$endgroup$
In fact, equation 25 is $ [R|t] D = C$ and not $D [R|t] = C$ , and indeed $ [R|t] DD^T = CD^T$ , yielding $hat{[R|t]}= CD^T*(DD^T)^{-1}$
answered Dec 20 '18 at 8:29
user617446user617446
4443
4443
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
1
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
add a comment |
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
1
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
How did you get the second and third expressions? I know they match the text in the OP, but are you actually applying the least squares equation to get to it?
$endgroup$
– Carpetfizz
Dec 20 '18 at 8:31
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
I start from $[R|t]D=C$ and just right multiply by $D^T$ . The least squares is valid in exactly the same way, just consider $x^T A=b^T$ in your original definition.
$endgroup$
– user617446
Dec 20 '18 at 9:53
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Thank you, do you mind pointing me to a reference that talks about how to solve $x^TA = b^T$? Does the proof work the same way as the proof for solving $Ax = b$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 1:32
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
$begingroup$
Also, did you mean "consider $x^TA^T = b^T$ ?
$endgroup$
– Carpetfizz
Dec 21 '18 at 2:11
1
1
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
$begingroup$
The proof works the same way, since $x^T A-b^T = (A^T x-b)^T$ and the object to minimize, the norm squared, is the same.
$endgroup$
– user617446
Dec 23 '18 at 4:16
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3047227%2fsolving-for-a-matrix-using-least-squares%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Can you define what $K$, $R$, and $t$ are?
$endgroup$
– Wolfy
Dec 20 '18 at 6:34
$begingroup$
Yes, sorry. K is a 3x3 “camera matrix”, R is a 3x3 rotation matrix, and t is a 3x1 translation vector
$endgroup$
– Carpetfizz
Dec 20 '18 at 6:35
$begingroup$
Okay, please edit your question, so other people know as well :).
$endgroup$
– Wolfy
Dec 20 '18 at 6:36
$begingroup$
These are two forms of the pseudo inverse matrix. We select one or the other depending on the dimensions of $D$, when $D$ is not square. When $D$ is square and full rank, no difference. An easy demonstration if $D$ is square: consider SVD ...
$endgroup$
– Damien
Dec 20 '18 at 9:12
$begingroup$
A precision: if $D$ is not square, one of the two forms is invalid ...
$endgroup$
– Damien
Dec 20 '18 at 9:15