Find the viewing angles of a cube from a projection of its edges












2














If I project a cube's corner on a plane by photographing it from a distance I get three lines radiating from a point. From two angles $A$, $B$ made by these three lines in the plane, I should be able to calculate the viewing angles relative to the cube's ($mathbf{hat{x}}$, $mathbf{hat{y}}$, $mathbf{hat{z}}$) axes in spherical coordinages.



I should be able to, but I can't right now. I need a helpful hint how to do this projection without going too deep into projective geometry



I'm just asking about the simple math problem here; photogrammetry is a whole topic unto itself.



Cropped from 17-Oct-2018 NASA ICE tweet, (sadly, the dimensions are not in the ratio 1:4:9)



enter image description here










share|cite|improve this question
























  • Are you assuming that the side of the cube is parallel to your "plan"?
    – Moti
    Oct 23 '18 at 5:13










  • @Moti no. The "view angle" would express in what way they are different. I'm flexible on coordinate systems, but for example the normal direction to the "plan" could be expressed in spherical coordinates relative the $mathbf{hat{z}}$ direction. I don't care about rotation around that. Just what the two angles $A$, $B$ provide. Thanks
    – uhoh
    Oct 23 '18 at 5:41










  • I can do something with descriptive geometry and trig but it ignores perspective. It calculates the true angles of A and B with z projected onto the top surface. One also needs the photographic scale. I could give you a specific example using a unit cube.
    – Phil H
    Oct 23 '18 at 6:56












  • @PhilH for what I need, a scale wouldn't be necessary; just two angles in, two angles out.
    – uhoh
    Oct 23 '18 at 11:53






  • 1




    @uhoh see edit to my answer.
    – Phil H
    Oct 23 '18 at 23:24
















2














If I project a cube's corner on a plane by photographing it from a distance I get three lines radiating from a point. From two angles $A$, $B$ made by these three lines in the plane, I should be able to calculate the viewing angles relative to the cube's ($mathbf{hat{x}}$, $mathbf{hat{y}}$, $mathbf{hat{z}}$) axes in spherical coordinages.



I should be able to, but I can't right now. I need a helpful hint how to do this projection without going too deep into projective geometry



I'm just asking about the simple math problem here; photogrammetry is a whole topic unto itself.



Cropped from 17-Oct-2018 NASA ICE tweet, (sadly, the dimensions are not in the ratio 1:4:9)



enter image description here










share|cite|improve this question
























  • Are you assuming that the side of the cube is parallel to your "plan"?
    – Moti
    Oct 23 '18 at 5:13










  • @Moti no. The "view angle" would express in what way they are different. I'm flexible on coordinate systems, but for example the normal direction to the "plan" could be expressed in spherical coordinates relative the $mathbf{hat{z}}$ direction. I don't care about rotation around that. Just what the two angles $A$, $B$ provide. Thanks
    – uhoh
    Oct 23 '18 at 5:41










  • I can do something with descriptive geometry and trig but it ignores perspective. It calculates the true angles of A and B with z projected onto the top surface. One also needs the photographic scale. I could give you a specific example using a unit cube.
    – Phil H
    Oct 23 '18 at 6:56












  • @PhilH for what I need, a scale wouldn't be necessary; just two angles in, two angles out.
    – uhoh
    Oct 23 '18 at 11:53






  • 1




    @uhoh see edit to my answer.
    – Phil H
    Oct 23 '18 at 23:24














2












2








2







If I project a cube's corner on a plane by photographing it from a distance I get three lines radiating from a point. From two angles $A$, $B$ made by these three lines in the plane, I should be able to calculate the viewing angles relative to the cube's ($mathbf{hat{x}}$, $mathbf{hat{y}}$, $mathbf{hat{z}}$) axes in spherical coordinages.



I should be able to, but I can't right now. I need a helpful hint how to do this projection without going too deep into projective geometry



I'm just asking about the simple math problem here; photogrammetry is a whole topic unto itself.



Cropped from 17-Oct-2018 NASA ICE tweet, (sadly, the dimensions are not in the ratio 1:4:9)



enter image description here










share|cite|improve this question















If I project a cube's corner on a plane by photographing it from a distance I get three lines radiating from a point. From two angles $A$, $B$ made by these three lines in the plane, I should be able to calculate the viewing angles relative to the cube's ($mathbf{hat{x}}$, $mathbf{hat{y}}$, $mathbf{hat{z}}$) axes in spherical coordinages.



I should be able to, but I can't right now. I need a helpful hint how to do this projection without going too deep into projective geometry



I'm just asking about the simple math problem here; photogrammetry is a whole topic unto itself.



Cropped from 17-Oct-2018 NASA ICE tweet, (sadly, the dimensions are not in the ratio 1:4:9)



enter image description here







geometry projective-geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Oct 23 '18 at 3:44

























asked Oct 23 '18 at 3:14









uhoh

4411515




4411515












  • Are you assuming that the side of the cube is parallel to your "plan"?
    – Moti
    Oct 23 '18 at 5:13










  • @Moti no. The "view angle" would express in what way they are different. I'm flexible on coordinate systems, but for example the normal direction to the "plan" could be expressed in spherical coordinates relative the $mathbf{hat{z}}$ direction. I don't care about rotation around that. Just what the two angles $A$, $B$ provide. Thanks
    – uhoh
    Oct 23 '18 at 5:41










  • I can do something with descriptive geometry and trig but it ignores perspective. It calculates the true angles of A and B with z projected onto the top surface. One also needs the photographic scale. I could give you a specific example using a unit cube.
    – Phil H
    Oct 23 '18 at 6:56












  • @PhilH for what I need, a scale wouldn't be necessary; just two angles in, two angles out.
    – uhoh
    Oct 23 '18 at 11:53






  • 1




    @uhoh see edit to my answer.
    – Phil H
    Oct 23 '18 at 23:24


















  • Are you assuming that the side of the cube is parallel to your "plan"?
    – Moti
    Oct 23 '18 at 5:13










  • @Moti no. The "view angle" would express in what way they are different. I'm flexible on coordinate systems, but for example the normal direction to the "plan" could be expressed in spherical coordinates relative the $mathbf{hat{z}}$ direction. I don't care about rotation around that. Just what the two angles $A$, $B$ provide. Thanks
    – uhoh
    Oct 23 '18 at 5:41










  • I can do something with descriptive geometry and trig but it ignores perspective. It calculates the true angles of A and B with z projected onto the top surface. One also needs the photographic scale. I could give you a specific example using a unit cube.
    – Phil H
    Oct 23 '18 at 6:56












  • @PhilH for what I need, a scale wouldn't be necessary; just two angles in, two angles out.
    – uhoh
    Oct 23 '18 at 11:53






  • 1




    @uhoh see edit to my answer.
    – Phil H
    Oct 23 '18 at 23:24
















Are you assuming that the side of the cube is parallel to your "plan"?
– Moti
Oct 23 '18 at 5:13




Are you assuming that the side of the cube is parallel to your "plan"?
– Moti
Oct 23 '18 at 5:13












@Moti no. The "view angle" would express in what way they are different. I'm flexible on coordinate systems, but for example the normal direction to the "plan" could be expressed in spherical coordinates relative the $mathbf{hat{z}}$ direction. I don't care about rotation around that. Just what the two angles $A$, $B$ provide. Thanks
– uhoh
Oct 23 '18 at 5:41




@Moti no. The "view angle" would express in what way they are different. I'm flexible on coordinate systems, but for example the normal direction to the "plan" could be expressed in spherical coordinates relative the $mathbf{hat{z}}$ direction. I don't care about rotation around that. Just what the two angles $A$, $B$ provide. Thanks
– uhoh
Oct 23 '18 at 5:41












I can do something with descriptive geometry and trig but it ignores perspective. It calculates the true angles of A and B with z projected onto the top surface. One also needs the photographic scale. I could give you a specific example using a unit cube.
– Phil H
Oct 23 '18 at 6:56






I can do something with descriptive geometry and trig but it ignores perspective. It calculates the true angles of A and B with z projected onto the top surface. One also needs the photographic scale. I could give you a specific example using a unit cube.
– Phil H
Oct 23 '18 at 6:56














@PhilH for what I need, a scale wouldn't be necessary; just two angles in, two angles out.
– uhoh
Oct 23 '18 at 11:53




@PhilH for what I need, a scale wouldn't be necessary; just two angles in, two angles out.
– uhoh
Oct 23 '18 at 11:53




1




1




@uhoh see edit to my answer.
– Phil H
Oct 23 '18 at 23:24




@uhoh see edit to my answer.
– Phil H
Oct 23 '18 at 23:24










2 Answers
2






active

oldest

votes


















2














Well, I gave it a shot but couldn't come up with an easy way to solve the equation for $phi$ except guess and check. Someone more knowledgeable may know.
Edit: Someone helped me with the equation (thanks Yves) so it's now easier to solve for $phi$.



enter image description here



I've added some further explanation. I should clarify that angles A,A',B, B' are all on the top surface of the cube between the z axis projected onto the $xy$ plane, and the $x$ and $y$ axes. We are trying to determine the polar coordinates of the line of view which includes two angles. These are, the angle the line of sight makes with the positive $x$ axis (angle $A$ can be used to determine $theta$) and the angle the line of sight makes with the $z$ axis (angle $phi$). I've projected a true view of the top surface and shown how the two dark triangles, co-planar with the top surface of the cube, have been elongated along their adjacent sides from $a1$ to $a2$. Angle $phi$ is the angle the top surface is tilted through to become a true view. Sorry about the projection lines not matching up I couldn't get it all on one image.



enter image description here



enter image description here



enter image description here






share|cite|improve this answer























  • Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
    – uhoh
    Oct 23 '18 at 23:33










  • How did you come up with $A+B=90°$?
    – amd
    Oct 24 '18 at 1:16










  • @amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
    – Phil H
    Oct 24 '18 at 2:50










  • That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
    – amd
    Oct 24 '18 at 3:34






  • 1




    Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
    – amd
    Oct 24 '18 at 9:06



















2














For a general perspective projection, knowing the directions of the images of the coordinate axes at some image point (or the angles between them) isn’t enough to recover the camera’s attitude. The problem is that their vanishing points are usually finite, so these angles depend on the location in the image. For the image in your question, it’s probably safe to assume that the object is far from the camera and that the range of depths in that part of the image is small relative to this distance. This allows us to approximate the perspective projection with an orthographic projection—i.e., to use an affine camera. (Hartley & Zisserman discuss the errors in this approximation in Multiple View Geometry In Computer Vision §6.3.) The nice thing about this approximation for our purposes is that vanishing points of lines that are not parallel to the projection direction are all at infinity—parallel lines are mapped to parallel lines—so that the directions of the coordinate axis images don’t depend on the position in the image.



An affine camera matrix can be decomposed as $$mathtt P = begin{bmatrix} mathtt K_{2times2} & mathbf t \ mathbf 0^T & 1 end{bmatrix} begin{bmatrix} mathtt R_2 & mathbf 0 \ mathbf 0^T & 1 end{bmatrix}.$$ Here, $mathtt R_2$ is the first two rows of a $3times3$ rotation matrix $mathtt R$, the intrinsic matrix $mathtt K_{2times2}$ is upper-triangular, and $mathbf t$ is the image coordinates of the world coordinate system origin. We’re essentially trying to recover the missing third row $mathbf r^3$ of $mathtt R$. This is the world-coordinate direction vector that points from the origin toward the camera.



The translation $mathbf t$ only affects the last column of $mathtt P$, which we don’t care about, so we can safely ignore it. If we assume square pixels and no skew, then, up to an irrelevant constant factor $mathtt K_{2times2}=mathtt I_{2times2}$, reducing $mathtt P$ to the matrix at right. The first three columns of a camera matrix are the image coordinates of the world coordinate axes’ vanishing points, so if $mathbf x$, $mathbf y$ and $mathbf z$ are the direction vectors measured from the image, we have $$mathtt R_2 = begin{bmatrix}lambdamathbf x & mumathbf y & taumathbf zend{bmatrix}$$ for some positive scale factors $lambda$, $mu$ and $tau$. The rotation matrix $mathtt R$ is orthogonal, so $mathbf r^3 = mathbf r^1timesmathbf r^2$. You can then convert this to spherical coordinates, if desired. Note that we’ve recovered the entire rotation matrix, so you also have the camera’s roll angle, should you want it. To find the scale factors, use orthogonality of $mathtt R$ again: $mathtt R_2mathtt R_2^T=mathtt I_{2times2}$. This produces a system of three linear equations in $lambda^2$, $mu^2$ and $tau^2$ that you can solve using standard methods. I would simply substitute the resulting positive square roots into $mathtt R_2$ and then compute the cross product of the rows, but if you want a closed-form solution, it’s not too hard to substitute and simplify, although you should be careful to preserve the signs of the elements of $mathtt R_2$ when canceling against terms under the radicals.



Working from the image in your question, I measure $mathbf x = (178,20)^T$, $mathbf y = (-162,58)^T$, $mathbf z=(-3,166)^T$. Applying the above method yields $mathbf r^{3T}approx$ (-0.438, -0.879, 0.189), which has an azimuth of -116.5° and polar angle 79.12°. Using this projection direction produces this picture:



projected axes



which looks about right.



The above isn’t quite the solution that you asked for, but only a small modification is required to work with a pair of angles instead. Essentially, we rotate the image coordinate system so that $mathbf z = (0,1)^T$. We then start from $$mathtt R_2 = begin{bmatrix}pmlambdasin A & pmmusin B & 0 \ pmlambdacos A & pmmucos B & tauend{bmatrix},$$ with the signs chosen to reflect the correct quadrants relative to the plumb line $mathbf z$. Using the angles from the example in Phil H’s answer, this method produces $mathbf r^{3T} approx$ (-0.4449, -0.618222, 0.64797), which corresponds to an azimuth of -125.74° and polar angle 49.6113°, the same result as in that other answer.



There are a few degenerate configurations to deal with. If any of the image lines coincide, there’s no way to retrieve the view direction without more information, such as known lengths along the axes that coincided. If the projection is parallel to one of the world coordinate axes, its image will be a single point instead of a line, so the above method doesn’t apply. It’s easy enough to work out an appropriate rotation from the remaining visible axis images, though. An interesting degenerate configuration is when the three vectors are equally spaced: the corresponding linear system has only the trivial solution. I suppose that this null result is reflective of the ambiguity that’s in the old “tiers of cubes” optical illusion. Since you know which edge is which, though, this can be disambiguated, but the above algorithm is of no help.



I haven’t looked into whether the aspect ratio or no-skew restrictions can be relaxed without requiring additional data from the image and scene.






share|cite|improve this answer























  • Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
    – uhoh
    Oct 25 '18 at 6:42








  • 1




    I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
    – amd
    Oct 25 '18 at 18:08










  • I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
    – uhoh
    Oct 28 '18 at 6:22










  • actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
    – uhoh
    Oct 28 '18 at 6:32












  • @uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
    – amd
    Oct 29 '18 at 5:21











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2967046%2ffind-the-viewing-angles-of-a-cube-from-a-projection-of-its-edges%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














Well, I gave it a shot but couldn't come up with an easy way to solve the equation for $phi$ except guess and check. Someone more knowledgeable may know.
Edit: Someone helped me with the equation (thanks Yves) so it's now easier to solve for $phi$.



enter image description here



I've added some further explanation. I should clarify that angles A,A',B, B' are all on the top surface of the cube between the z axis projected onto the $xy$ plane, and the $x$ and $y$ axes. We are trying to determine the polar coordinates of the line of view which includes two angles. These are, the angle the line of sight makes with the positive $x$ axis (angle $A$ can be used to determine $theta$) and the angle the line of sight makes with the $z$ axis (angle $phi$). I've projected a true view of the top surface and shown how the two dark triangles, co-planar with the top surface of the cube, have been elongated along their adjacent sides from $a1$ to $a2$. Angle $phi$ is the angle the top surface is tilted through to become a true view. Sorry about the projection lines not matching up I couldn't get it all on one image.



enter image description here



enter image description here



enter image description here






share|cite|improve this answer























  • Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
    – uhoh
    Oct 23 '18 at 23:33










  • How did you come up with $A+B=90°$?
    – amd
    Oct 24 '18 at 1:16










  • @amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
    – Phil H
    Oct 24 '18 at 2:50










  • That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
    – amd
    Oct 24 '18 at 3:34






  • 1




    Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
    – amd
    Oct 24 '18 at 9:06
















2














Well, I gave it a shot but couldn't come up with an easy way to solve the equation for $phi$ except guess and check. Someone more knowledgeable may know.
Edit: Someone helped me with the equation (thanks Yves) so it's now easier to solve for $phi$.



enter image description here



I've added some further explanation. I should clarify that angles A,A',B, B' are all on the top surface of the cube between the z axis projected onto the $xy$ plane, and the $x$ and $y$ axes. We are trying to determine the polar coordinates of the line of view which includes two angles. These are, the angle the line of sight makes with the positive $x$ axis (angle $A$ can be used to determine $theta$) and the angle the line of sight makes with the $z$ axis (angle $phi$). I've projected a true view of the top surface and shown how the two dark triangles, co-planar with the top surface of the cube, have been elongated along their adjacent sides from $a1$ to $a2$. Angle $phi$ is the angle the top surface is tilted through to become a true view. Sorry about the projection lines not matching up I couldn't get it all on one image.



enter image description here



enter image description here



enter image description here






share|cite|improve this answer























  • Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
    – uhoh
    Oct 23 '18 at 23:33










  • How did you come up with $A+B=90°$?
    – amd
    Oct 24 '18 at 1:16










  • @amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
    – Phil H
    Oct 24 '18 at 2:50










  • That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
    – amd
    Oct 24 '18 at 3:34






  • 1




    Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
    – amd
    Oct 24 '18 at 9:06














2












2








2






Well, I gave it a shot but couldn't come up with an easy way to solve the equation for $phi$ except guess and check. Someone more knowledgeable may know.
Edit: Someone helped me with the equation (thanks Yves) so it's now easier to solve for $phi$.



enter image description here



I've added some further explanation. I should clarify that angles A,A',B, B' are all on the top surface of the cube between the z axis projected onto the $xy$ plane, and the $x$ and $y$ axes. We are trying to determine the polar coordinates of the line of view which includes two angles. These are, the angle the line of sight makes with the positive $x$ axis (angle $A$ can be used to determine $theta$) and the angle the line of sight makes with the $z$ axis (angle $phi$). I've projected a true view of the top surface and shown how the two dark triangles, co-planar with the top surface of the cube, have been elongated along their adjacent sides from $a1$ to $a2$. Angle $phi$ is the angle the top surface is tilted through to become a true view. Sorry about the projection lines not matching up I couldn't get it all on one image.



enter image description here



enter image description here



enter image description here






share|cite|improve this answer














Well, I gave it a shot but couldn't come up with an easy way to solve the equation for $phi$ except guess and check. Someone more knowledgeable may know.
Edit: Someone helped me with the equation (thanks Yves) so it's now easier to solve for $phi$.



enter image description here



I've added some further explanation. I should clarify that angles A,A',B, B' are all on the top surface of the cube between the z axis projected onto the $xy$ plane, and the $x$ and $y$ axes. We are trying to determine the polar coordinates of the line of view which includes two angles. These are, the angle the line of sight makes with the positive $x$ axis (angle $A$ can be used to determine $theta$) and the angle the line of sight makes with the $z$ axis (angle $phi$). I've projected a true view of the top surface and shown how the two dark triangles, co-planar with the top surface of the cube, have been elongated along their adjacent sides from $a1$ to $a2$. Angle $phi$ is the angle the top surface is tilted through to become a true view. Sorry about the projection lines not matching up I couldn't get it all on one image.



enter image description here



enter image description here



enter image description here







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Oct 24 '18 at 18:25

























answered Oct 23 '18 at 19:49









Phil H

4,0462312




4,0462312












  • Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
    – uhoh
    Oct 23 '18 at 23:33










  • How did you come up with $A+B=90°$?
    – amd
    Oct 24 '18 at 1:16










  • @amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
    – Phil H
    Oct 24 '18 at 2:50










  • That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
    – amd
    Oct 24 '18 at 3:34






  • 1




    Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
    – amd
    Oct 24 '18 at 9:06


















  • Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
    – uhoh
    Oct 23 '18 at 23:33










  • How did you come up with $A+B=90°$?
    – amd
    Oct 24 '18 at 1:16










  • @amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
    – Phil H
    Oct 24 '18 at 2:50










  • That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
    – amd
    Oct 24 '18 at 3:34






  • 1




    Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
    – amd
    Oct 24 '18 at 9:06
















Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
– uhoh
Oct 23 '18 at 23:33




Thanks! I'll give it a test drive shortly. At some point if you have a chance, a few words about how you were able to solve this would be great, what was the approach would be great for me, and future readers.
– uhoh
Oct 23 '18 at 23:33












How did you come up with $A+B=90°$?
– amd
Oct 24 '18 at 1:16




How did you come up with $A+B=90°$?
– amd
Oct 24 '18 at 1:16












@amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
– Phil H
Oct 24 '18 at 2:50




@amd A and B are the two angles that make up the corner of a cube per the title, also the angle between the x and y axes. We want to know A as the polar coordinate from the x axis.
– Phil H
Oct 24 '18 at 2:50












That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
– amd
Oct 24 '18 at 3:34




That doesn’t make sense to me. Be that as it may, what happens when $tan(A')tan(B')lt0$?
– amd
Oct 24 '18 at 3:34




1




1




Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
– amd
Oct 24 '18 at 9:06




Hmm... I think there might need to be a sign adjustment somewhere. Placing the viewpoint at the angles in your example doesn’t produce the right picture, but adding 180° to $theta$ does.
– amd
Oct 24 '18 at 9:06











2














For a general perspective projection, knowing the directions of the images of the coordinate axes at some image point (or the angles between them) isn’t enough to recover the camera’s attitude. The problem is that their vanishing points are usually finite, so these angles depend on the location in the image. For the image in your question, it’s probably safe to assume that the object is far from the camera and that the range of depths in that part of the image is small relative to this distance. This allows us to approximate the perspective projection with an orthographic projection—i.e., to use an affine camera. (Hartley & Zisserman discuss the errors in this approximation in Multiple View Geometry In Computer Vision §6.3.) The nice thing about this approximation for our purposes is that vanishing points of lines that are not parallel to the projection direction are all at infinity—parallel lines are mapped to parallel lines—so that the directions of the coordinate axis images don’t depend on the position in the image.



An affine camera matrix can be decomposed as $$mathtt P = begin{bmatrix} mathtt K_{2times2} & mathbf t \ mathbf 0^T & 1 end{bmatrix} begin{bmatrix} mathtt R_2 & mathbf 0 \ mathbf 0^T & 1 end{bmatrix}.$$ Here, $mathtt R_2$ is the first two rows of a $3times3$ rotation matrix $mathtt R$, the intrinsic matrix $mathtt K_{2times2}$ is upper-triangular, and $mathbf t$ is the image coordinates of the world coordinate system origin. We’re essentially trying to recover the missing third row $mathbf r^3$ of $mathtt R$. This is the world-coordinate direction vector that points from the origin toward the camera.



The translation $mathbf t$ only affects the last column of $mathtt P$, which we don’t care about, so we can safely ignore it. If we assume square pixels and no skew, then, up to an irrelevant constant factor $mathtt K_{2times2}=mathtt I_{2times2}$, reducing $mathtt P$ to the matrix at right. The first three columns of a camera matrix are the image coordinates of the world coordinate axes’ vanishing points, so if $mathbf x$, $mathbf y$ and $mathbf z$ are the direction vectors measured from the image, we have $$mathtt R_2 = begin{bmatrix}lambdamathbf x & mumathbf y & taumathbf zend{bmatrix}$$ for some positive scale factors $lambda$, $mu$ and $tau$. The rotation matrix $mathtt R$ is orthogonal, so $mathbf r^3 = mathbf r^1timesmathbf r^2$. You can then convert this to spherical coordinates, if desired. Note that we’ve recovered the entire rotation matrix, so you also have the camera’s roll angle, should you want it. To find the scale factors, use orthogonality of $mathtt R$ again: $mathtt R_2mathtt R_2^T=mathtt I_{2times2}$. This produces a system of three linear equations in $lambda^2$, $mu^2$ and $tau^2$ that you can solve using standard methods. I would simply substitute the resulting positive square roots into $mathtt R_2$ and then compute the cross product of the rows, but if you want a closed-form solution, it’s not too hard to substitute and simplify, although you should be careful to preserve the signs of the elements of $mathtt R_2$ when canceling against terms under the radicals.



Working from the image in your question, I measure $mathbf x = (178,20)^T$, $mathbf y = (-162,58)^T$, $mathbf z=(-3,166)^T$. Applying the above method yields $mathbf r^{3T}approx$ (-0.438, -0.879, 0.189), which has an azimuth of -116.5° and polar angle 79.12°. Using this projection direction produces this picture:



projected axes



which looks about right.



The above isn’t quite the solution that you asked for, but only a small modification is required to work with a pair of angles instead. Essentially, we rotate the image coordinate system so that $mathbf z = (0,1)^T$. We then start from $$mathtt R_2 = begin{bmatrix}pmlambdasin A & pmmusin B & 0 \ pmlambdacos A & pmmucos B & tauend{bmatrix},$$ with the signs chosen to reflect the correct quadrants relative to the plumb line $mathbf z$. Using the angles from the example in Phil H’s answer, this method produces $mathbf r^{3T} approx$ (-0.4449, -0.618222, 0.64797), which corresponds to an azimuth of -125.74° and polar angle 49.6113°, the same result as in that other answer.



There are a few degenerate configurations to deal with. If any of the image lines coincide, there’s no way to retrieve the view direction without more information, such as known lengths along the axes that coincided. If the projection is parallel to one of the world coordinate axes, its image will be a single point instead of a line, so the above method doesn’t apply. It’s easy enough to work out an appropriate rotation from the remaining visible axis images, though. An interesting degenerate configuration is when the three vectors are equally spaced: the corresponding linear system has only the trivial solution. I suppose that this null result is reflective of the ambiguity that’s in the old “tiers of cubes” optical illusion. Since you know which edge is which, though, this can be disambiguated, but the above algorithm is of no help.



I haven’t looked into whether the aspect ratio or no-skew restrictions can be relaxed without requiring additional data from the image and scene.






share|cite|improve this answer























  • Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
    – uhoh
    Oct 25 '18 at 6:42








  • 1




    I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
    – amd
    Oct 25 '18 at 18:08










  • I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
    – uhoh
    Oct 28 '18 at 6:22










  • actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
    – uhoh
    Oct 28 '18 at 6:32












  • @uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
    – amd
    Oct 29 '18 at 5:21
















2














For a general perspective projection, knowing the directions of the images of the coordinate axes at some image point (or the angles between them) isn’t enough to recover the camera’s attitude. The problem is that their vanishing points are usually finite, so these angles depend on the location in the image. For the image in your question, it’s probably safe to assume that the object is far from the camera and that the range of depths in that part of the image is small relative to this distance. This allows us to approximate the perspective projection with an orthographic projection—i.e., to use an affine camera. (Hartley & Zisserman discuss the errors in this approximation in Multiple View Geometry In Computer Vision §6.3.) The nice thing about this approximation for our purposes is that vanishing points of lines that are not parallel to the projection direction are all at infinity—parallel lines are mapped to parallel lines—so that the directions of the coordinate axis images don’t depend on the position in the image.



An affine camera matrix can be decomposed as $$mathtt P = begin{bmatrix} mathtt K_{2times2} & mathbf t \ mathbf 0^T & 1 end{bmatrix} begin{bmatrix} mathtt R_2 & mathbf 0 \ mathbf 0^T & 1 end{bmatrix}.$$ Here, $mathtt R_2$ is the first two rows of a $3times3$ rotation matrix $mathtt R$, the intrinsic matrix $mathtt K_{2times2}$ is upper-triangular, and $mathbf t$ is the image coordinates of the world coordinate system origin. We’re essentially trying to recover the missing third row $mathbf r^3$ of $mathtt R$. This is the world-coordinate direction vector that points from the origin toward the camera.



The translation $mathbf t$ only affects the last column of $mathtt P$, which we don’t care about, so we can safely ignore it. If we assume square pixels and no skew, then, up to an irrelevant constant factor $mathtt K_{2times2}=mathtt I_{2times2}$, reducing $mathtt P$ to the matrix at right. The first three columns of a camera matrix are the image coordinates of the world coordinate axes’ vanishing points, so if $mathbf x$, $mathbf y$ and $mathbf z$ are the direction vectors measured from the image, we have $$mathtt R_2 = begin{bmatrix}lambdamathbf x & mumathbf y & taumathbf zend{bmatrix}$$ for some positive scale factors $lambda$, $mu$ and $tau$. The rotation matrix $mathtt R$ is orthogonal, so $mathbf r^3 = mathbf r^1timesmathbf r^2$. You can then convert this to spherical coordinates, if desired. Note that we’ve recovered the entire rotation matrix, so you also have the camera’s roll angle, should you want it. To find the scale factors, use orthogonality of $mathtt R$ again: $mathtt R_2mathtt R_2^T=mathtt I_{2times2}$. This produces a system of three linear equations in $lambda^2$, $mu^2$ and $tau^2$ that you can solve using standard methods. I would simply substitute the resulting positive square roots into $mathtt R_2$ and then compute the cross product of the rows, but if you want a closed-form solution, it’s not too hard to substitute and simplify, although you should be careful to preserve the signs of the elements of $mathtt R_2$ when canceling against terms under the radicals.



Working from the image in your question, I measure $mathbf x = (178,20)^T$, $mathbf y = (-162,58)^T$, $mathbf z=(-3,166)^T$. Applying the above method yields $mathbf r^{3T}approx$ (-0.438, -0.879, 0.189), which has an azimuth of -116.5° and polar angle 79.12°. Using this projection direction produces this picture:



projected axes



which looks about right.



The above isn’t quite the solution that you asked for, but only a small modification is required to work with a pair of angles instead. Essentially, we rotate the image coordinate system so that $mathbf z = (0,1)^T$. We then start from $$mathtt R_2 = begin{bmatrix}pmlambdasin A & pmmusin B & 0 \ pmlambdacos A & pmmucos B & tauend{bmatrix},$$ with the signs chosen to reflect the correct quadrants relative to the plumb line $mathbf z$. Using the angles from the example in Phil H’s answer, this method produces $mathbf r^{3T} approx$ (-0.4449, -0.618222, 0.64797), which corresponds to an azimuth of -125.74° and polar angle 49.6113°, the same result as in that other answer.



There are a few degenerate configurations to deal with. If any of the image lines coincide, there’s no way to retrieve the view direction without more information, such as known lengths along the axes that coincided. If the projection is parallel to one of the world coordinate axes, its image will be a single point instead of a line, so the above method doesn’t apply. It’s easy enough to work out an appropriate rotation from the remaining visible axis images, though. An interesting degenerate configuration is when the three vectors are equally spaced: the corresponding linear system has only the trivial solution. I suppose that this null result is reflective of the ambiguity that’s in the old “tiers of cubes” optical illusion. Since you know which edge is which, though, this can be disambiguated, but the above algorithm is of no help.



I haven’t looked into whether the aspect ratio or no-skew restrictions can be relaxed without requiring additional data from the image and scene.






share|cite|improve this answer























  • Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
    – uhoh
    Oct 25 '18 at 6:42








  • 1




    I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
    – amd
    Oct 25 '18 at 18:08










  • I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
    – uhoh
    Oct 28 '18 at 6:22










  • actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
    – uhoh
    Oct 28 '18 at 6:32












  • @uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
    – amd
    Oct 29 '18 at 5:21














2












2








2






For a general perspective projection, knowing the directions of the images of the coordinate axes at some image point (or the angles between them) isn’t enough to recover the camera’s attitude. The problem is that their vanishing points are usually finite, so these angles depend on the location in the image. For the image in your question, it’s probably safe to assume that the object is far from the camera and that the range of depths in that part of the image is small relative to this distance. This allows us to approximate the perspective projection with an orthographic projection—i.e., to use an affine camera. (Hartley & Zisserman discuss the errors in this approximation in Multiple View Geometry In Computer Vision §6.3.) The nice thing about this approximation for our purposes is that vanishing points of lines that are not parallel to the projection direction are all at infinity—parallel lines are mapped to parallel lines—so that the directions of the coordinate axis images don’t depend on the position in the image.



An affine camera matrix can be decomposed as $$mathtt P = begin{bmatrix} mathtt K_{2times2} & mathbf t \ mathbf 0^T & 1 end{bmatrix} begin{bmatrix} mathtt R_2 & mathbf 0 \ mathbf 0^T & 1 end{bmatrix}.$$ Here, $mathtt R_2$ is the first two rows of a $3times3$ rotation matrix $mathtt R$, the intrinsic matrix $mathtt K_{2times2}$ is upper-triangular, and $mathbf t$ is the image coordinates of the world coordinate system origin. We’re essentially trying to recover the missing third row $mathbf r^3$ of $mathtt R$. This is the world-coordinate direction vector that points from the origin toward the camera.



The translation $mathbf t$ only affects the last column of $mathtt P$, which we don’t care about, so we can safely ignore it. If we assume square pixels and no skew, then, up to an irrelevant constant factor $mathtt K_{2times2}=mathtt I_{2times2}$, reducing $mathtt P$ to the matrix at right. The first three columns of a camera matrix are the image coordinates of the world coordinate axes’ vanishing points, so if $mathbf x$, $mathbf y$ and $mathbf z$ are the direction vectors measured from the image, we have $$mathtt R_2 = begin{bmatrix}lambdamathbf x & mumathbf y & taumathbf zend{bmatrix}$$ for some positive scale factors $lambda$, $mu$ and $tau$. The rotation matrix $mathtt R$ is orthogonal, so $mathbf r^3 = mathbf r^1timesmathbf r^2$. You can then convert this to spherical coordinates, if desired. Note that we’ve recovered the entire rotation matrix, so you also have the camera’s roll angle, should you want it. To find the scale factors, use orthogonality of $mathtt R$ again: $mathtt R_2mathtt R_2^T=mathtt I_{2times2}$. This produces a system of three linear equations in $lambda^2$, $mu^2$ and $tau^2$ that you can solve using standard methods. I would simply substitute the resulting positive square roots into $mathtt R_2$ and then compute the cross product of the rows, but if you want a closed-form solution, it’s not too hard to substitute and simplify, although you should be careful to preserve the signs of the elements of $mathtt R_2$ when canceling against terms under the radicals.



Working from the image in your question, I measure $mathbf x = (178,20)^T$, $mathbf y = (-162,58)^T$, $mathbf z=(-3,166)^T$. Applying the above method yields $mathbf r^{3T}approx$ (-0.438, -0.879, 0.189), which has an azimuth of -116.5° and polar angle 79.12°. Using this projection direction produces this picture:



projected axes



which looks about right.



The above isn’t quite the solution that you asked for, but only a small modification is required to work with a pair of angles instead. Essentially, we rotate the image coordinate system so that $mathbf z = (0,1)^T$. We then start from $$mathtt R_2 = begin{bmatrix}pmlambdasin A & pmmusin B & 0 \ pmlambdacos A & pmmucos B & tauend{bmatrix},$$ with the signs chosen to reflect the correct quadrants relative to the plumb line $mathbf z$. Using the angles from the example in Phil H’s answer, this method produces $mathbf r^{3T} approx$ (-0.4449, -0.618222, 0.64797), which corresponds to an azimuth of -125.74° and polar angle 49.6113°, the same result as in that other answer.



There are a few degenerate configurations to deal with. If any of the image lines coincide, there’s no way to retrieve the view direction without more information, such as known lengths along the axes that coincided. If the projection is parallel to one of the world coordinate axes, its image will be a single point instead of a line, so the above method doesn’t apply. It’s easy enough to work out an appropriate rotation from the remaining visible axis images, though. An interesting degenerate configuration is when the three vectors are equally spaced: the corresponding linear system has only the trivial solution. I suppose that this null result is reflective of the ambiguity that’s in the old “tiers of cubes” optical illusion. Since you know which edge is which, though, this can be disambiguated, but the above algorithm is of no help.



I haven’t looked into whether the aspect ratio or no-skew restrictions can be relaxed without requiring additional data from the image and scene.






share|cite|improve this answer














For a general perspective projection, knowing the directions of the images of the coordinate axes at some image point (or the angles between them) isn’t enough to recover the camera’s attitude. The problem is that their vanishing points are usually finite, so these angles depend on the location in the image. For the image in your question, it’s probably safe to assume that the object is far from the camera and that the range of depths in that part of the image is small relative to this distance. This allows us to approximate the perspective projection with an orthographic projection—i.e., to use an affine camera. (Hartley & Zisserman discuss the errors in this approximation in Multiple View Geometry In Computer Vision §6.3.) The nice thing about this approximation for our purposes is that vanishing points of lines that are not parallel to the projection direction are all at infinity—parallel lines are mapped to parallel lines—so that the directions of the coordinate axis images don’t depend on the position in the image.



An affine camera matrix can be decomposed as $$mathtt P = begin{bmatrix} mathtt K_{2times2} & mathbf t \ mathbf 0^T & 1 end{bmatrix} begin{bmatrix} mathtt R_2 & mathbf 0 \ mathbf 0^T & 1 end{bmatrix}.$$ Here, $mathtt R_2$ is the first two rows of a $3times3$ rotation matrix $mathtt R$, the intrinsic matrix $mathtt K_{2times2}$ is upper-triangular, and $mathbf t$ is the image coordinates of the world coordinate system origin. We’re essentially trying to recover the missing third row $mathbf r^3$ of $mathtt R$. This is the world-coordinate direction vector that points from the origin toward the camera.



The translation $mathbf t$ only affects the last column of $mathtt P$, which we don’t care about, so we can safely ignore it. If we assume square pixels and no skew, then, up to an irrelevant constant factor $mathtt K_{2times2}=mathtt I_{2times2}$, reducing $mathtt P$ to the matrix at right. The first three columns of a camera matrix are the image coordinates of the world coordinate axes’ vanishing points, so if $mathbf x$, $mathbf y$ and $mathbf z$ are the direction vectors measured from the image, we have $$mathtt R_2 = begin{bmatrix}lambdamathbf x & mumathbf y & taumathbf zend{bmatrix}$$ for some positive scale factors $lambda$, $mu$ and $tau$. The rotation matrix $mathtt R$ is orthogonal, so $mathbf r^3 = mathbf r^1timesmathbf r^2$. You can then convert this to spherical coordinates, if desired. Note that we’ve recovered the entire rotation matrix, so you also have the camera’s roll angle, should you want it. To find the scale factors, use orthogonality of $mathtt R$ again: $mathtt R_2mathtt R_2^T=mathtt I_{2times2}$. This produces a system of three linear equations in $lambda^2$, $mu^2$ and $tau^2$ that you can solve using standard methods. I would simply substitute the resulting positive square roots into $mathtt R_2$ and then compute the cross product of the rows, but if you want a closed-form solution, it’s not too hard to substitute and simplify, although you should be careful to preserve the signs of the elements of $mathtt R_2$ when canceling against terms under the radicals.



Working from the image in your question, I measure $mathbf x = (178,20)^T$, $mathbf y = (-162,58)^T$, $mathbf z=(-3,166)^T$. Applying the above method yields $mathbf r^{3T}approx$ (-0.438, -0.879, 0.189), which has an azimuth of -116.5° and polar angle 79.12°. Using this projection direction produces this picture:



projected axes



which looks about right.



The above isn’t quite the solution that you asked for, but only a small modification is required to work with a pair of angles instead. Essentially, we rotate the image coordinate system so that $mathbf z = (0,1)^T$. We then start from $$mathtt R_2 = begin{bmatrix}pmlambdasin A & pmmusin B & 0 \ pmlambdacos A & pmmucos B & tauend{bmatrix},$$ with the signs chosen to reflect the correct quadrants relative to the plumb line $mathbf z$. Using the angles from the example in Phil H’s answer, this method produces $mathbf r^{3T} approx$ (-0.4449, -0.618222, 0.64797), which corresponds to an azimuth of -125.74° and polar angle 49.6113°, the same result as in that other answer.



There are a few degenerate configurations to deal with. If any of the image lines coincide, there’s no way to retrieve the view direction without more information, such as known lengths along the axes that coincided. If the projection is parallel to one of the world coordinate axes, its image will be a single point instead of a line, so the above method doesn’t apply. It’s easy enough to work out an appropriate rotation from the remaining visible axis images, though. An interesting degenerate configuration is when the three vectors are equally spaced: the corresponding linear system has only the trivial solution. I suppose that this null result is reflective of the ambiguity that’s in the old “tiers of cubes” optical illusion. Since you know which edge is which, though, this can be disambiguated, but the above algorithm is of no help.



I haven’t looked into whether the aspect ratio or no-skew restrictions can be relaxed without requiring additional data from the image and scene.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited yesterday

























answered Oct 25 '18 at 6:05









amd

29.3k21050




29.3k21050












  • Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
    – uhoh
    Oct 25 '18 at 6:42








  • 1




    I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
    – amd
    Oct 25 '18 at 18:08










  • I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
    – uhoh
    Oct 28 '18 at 6:22










  • actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
    – uhoh
    Oct 28 '18 at 6:32












  • @uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
    – amd
    Oct 29 '18 at 5:21


















  • Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
    – uhoh
    Oct 25 '18 at 6:42








  • 1




    I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
    – amd
    Oct 25 '18 at 18:08










  • I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
    – uhoh
    Oct 28 '18 at 6:22










  • actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
    – uhoh
    Oct 28 '18 at 6:32












  • @uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
    – amd
    Oct 29 '18 at 5:21
















Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
– uhoh
Oct 25 '18 at 6:42






Very nice, thank you! I had meant to change "by photographing it from a distance" to be "...from a very large distance" but you've anticipated this anyway (as did the other answer). I will enjoy reading this through carefully today.
– uhoh
Oct 25 '18 at 6:42






1




1




I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
– amd
Oct 25 '18 at 18:08




I found it much easier to use coordinates than angles when working through the two examples. With angles, I found myself constantly having to adjust signs to get things to come out right. Coordinates “just worked.”
– amd
Oct 25 '18 at 18:08












I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
– uhoh
Oct 28 '18 at 6:22




I certainly see how $mathbf{x}, mathbf{y}, mathbf{z}$ comes from the original image, and how (-0.438, -0.879, 0.189) gives (-116.5°, 79.12°), but the secret sauce in the middle; "Applying the above method..." escapes me. I'm not a natural "affine transformer" so while your explanation is likely crystal clear for people who use transforms regularly, it's not to me. Why is the notation (R|RT) for “first apply translation then rotation”? shows how far I got a year ago, I wonder if it is possible to explain just a bit more, within that context?
– uhoh
Oct 28 '18 at 6:22












actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
– uhoh
Oct 28 '18 at 6:32






actually my question there is about the translation part and that's not so relevant here. I just need a plain language hint how to go from $mathbf{x}, mathbf{y}, mathbf{z}$ to $mathbf r^{3T}$ if that's possible, thanks!
– uhoh
Oct 28 '18 at 6:32














@uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
– amd
Oct 29 '18 at 5:21




@uhoh Do what the preceding paragraph says: multiply out $mathtt R_2mathtt R_2^T$, solve the resulting equations for $lambda^2$, $mu^2$ and $tau^2$, substitute back into $mathtt R_2$ and then take the cross product of its rows.
– amd
Oct 29 '18 at 5:21


















draft saved

draft discarded




















































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.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • 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.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2967046%2ffind-the-viewing-angles-of-a-cube-from-a-projection-of-its-edges%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Mario Kart Wii

What does “Dominus providebit” mean?

Antonio Litta Visconti Arese