How to convert back points in 2d to 3d with known orthogonal (camera) projection matrix?












0















I have a numpy array with 2d points that I convert from 3d to 2d via the following equation:



https://wikimedia.org/api/rest_v1/media/math/render/svg/198f15da062c7ce00598d7a2f9bd8169d7042ed3



How can I convert the point back to 3D?



I used the top down view matrix that is in the image above. Found in Wikiperia: https://en.wikipedia.org/wiki/Orthographic_projection



#To 2D from 3d:
points2D = np.array([np.matmul(camera_pos, point) for point in points3D])[:,:2]









share|improve this question























  • Inverse matrix doesn’t help you?

    – Bazingaa
    Jan 2 at 12:40











  • How do I get it?

    – Josue
    Jan 2 at 12:47











  • You need a depth value too

    – meowgoesthedog
    Jan 2 at 12:52
















0















I have a numpy array with 2d points that I convert from 3d to 2d via the following equation:



https://wikimedia.org/api/rest_v1/media/math/render/svg/198f15da062c7ce00598d7a2f9bd8169d7042ed3



How can I convert the point back to 3D?



I used the top down view matrix that is in the image above. Found in Wikiperia: https://en.wikipedia.org/wiki/Orthographic_projection



#To 2D from 3d:
points2D = np.array([np.matmul(camera_pos, point) for point in points3D])[:,:2]









share|improve this question























  • Inverse matrix doesn’t help you?

    – Bazingaa
    Jan 2 at 12:40











  • How do I get it?

    – Josue
    Jan 2 at 12:47











  • You need a depth value too

    – meowgoesthedog
    Jan 2 at 12:52














0












0








0








I have a numpy array with 2d points that I convert from 3d to 2d via the following equation:



https://wikimedia.org/api/rest_v1/media/math/render/svg/198f15da062c7ce00598d7a2f9bd8169d7042ed3



How can I convert the point back to 3D?



I used the top down view matrix that is in the image above. Found in Wikiperia: https://en.wikipedia.org/wiki/Orthographic_projection



#To 2D from 3d:
points2D = np.array([np.matmul(camera_pos, point) for point in points3D])[:,:2]









share|improve this question














I have a numpy array with 2d points that I convert from 3d to 2d via the following equation:



https://wikimedia.org/api/rest_v1/media/math/render/svg/198f15da062c7ce00598d7a2f9bd8169d7042ed3



How can I convert the point back to 3D?



I used the top down view matrix that is in the image above. Found in Wikiperia: https://en.wikipedia.org/wiki/Orthographic_projection



#To 2D from 3d:
points2D = np.array([np.matmul(camera_pos, point) for point in points3D])[:,:2]






python numpy 3d 2d projection-matrix






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 2 at 12:25









JosueJosue

31




31













  • Inverse matrix doesn’t help you?

    – Bazingaa
    Jan 2 at 12:40











  • How do I get it?

    – Josue
    Jan 2 at 12:47











  • You need a depth value too

    – meowgoesthedog
    Jan 2 at 12:52



















  • Inverse matrix doesn’t help you?

    – Bazingaa
    Jan 2 at 12:40











  • How do I get it?

    – Josue
    Jan 2 at 12:47











  • You need a depth value too

    – meowgoesthedog
    Jan 2 at 12:52

















Inverse matrix doesn’t help you?

– Bazingaa
Jan 2 at 12:40





Inverse matrix doesn’t help you?

– Bazingaa
Jan 2 at 12:40













How do I get it?

– Josue
Jan 2 at 12:47





How do I get it?

– Josue
Jan 2 at 12:47













You need a depth value too

– meowgoesthedog
Jan 2 at 12:52





You need a depth value too

– meowgoesthedog
Jan 2 at 12:52












1 Answer
1






active

oldest

votes


















0














You cannot convert it back using just the projected points. Note that your projection basically is just looking at the (x,y) values and discarding the z value so there is no way to know what z was after doing this.



For instance, consider the points u = [1,2,3] and v=[1,2,-3]. These both project to [1,2,0], so there is no way to know if we should make [1,2,0] into u or v when we try to invert (undo) the projection.



In terms of the matrix operation, this is because the projection matrices are not invertible (except the identity matrix).



You will need more information than just the projected points to be able to recover the original points.






share|improve this answer
























  • What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

    – Josue
    Jan 5 at 11:31











  • In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

    – tch
    Jan 6 at 3:40











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54006357%2fhow-to-convert-back-points-in-2d-to-3d-with-known-orthogonal-camera-projection%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









0














You cannot convert it back using just the projected points. Note that your projection basically is just looking at the (x,y) values and discarding the z value so there is no way to know what z was after doing this.



For instance, consider the points u = [1,2,3] and v=[1,2,-3]. These both project to [1,2,0], so there is no way to know if we should make [1,2,0] into u or v when we try to invert (undo) the projection.



In terms of the matrix operation, this is because the projection matrices are not invertible (except the identity matrix).



You will need more information than just the projected points to be able to recover the original points.






share|improve this answer
























  • What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

    – Josue
    Jan 5 at 11:31











  • In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

    – tch
    Jan 6 at 3:40
















0














You cannot convert it back using just the projected points. Note that your projection basically is just looking at the (x,y) values and discarding the z value so there is no way to know what z was after doing this.



For instance, consider the points u = [1,2,3] and v=[1,2,-3]. These both project to [1,2,0], so there is no way to know if we should make [1,2,0] into u or v when we try to invert (undo) the projection.



In terms of the matrix operation, this is because the projection matrices are not invertible (except the identity matrix).



You will need more information than just the projected points to be able to recover the original points.






share|improve this answer
























  • What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

    – Josue
    Jan 5 at 11:31











  • In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

    – tch
    Jan 6 at 3:40














0












0








0







You cannot convert it back using just the projected points. Note that your projection basically is just looking at the (x,y) values and discarding the z value so there is no way to know what z was after doing this.



For instance, consider the points u = [1,2,3] and v=[1,2,-3]. These both project to [1,2,0], so there is no way to know if we should make [1,2,0] into u or v when we try to invert (undo) the projection.



In terms of the matrix operation, this is because the projection matrices are not invertible (except the identity matrix).



You will need more information than just the projected points to be able to recover the original points.






share|improve this answer













You cannot convert it back using just the projected points. Note that your projection basically is just looking at the (x,y) values and discarding the z value so there is no way to know what z was after doing this.



For instance, consider the points u = [1,2,3] and v=[1,2,-3]. These both project to [1,2,0], so there is no way to know if we should make [1,2,0] into u or v when we try to invert (undo) the projection.



In terms of the matrix operation, this is because the projection matrices are not invertible (except the identity matrix).



You will need more information than just the projected points to be able to recover the original points.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 2 at 14:07









tchtch

48525




48525













  • What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

    – Josue
    Jan 5 at 11:31











  • In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

    – tch
    Jan 6 at 3:40



















  • What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

    – Josue
    Jan 5 at 11:31











  • In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

    – tch
    Jan 6 at 3:40

















What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

– Josue
Jan 5 at 11:31





What if I know that in THIS case there is only one point in the 3d space with the x and y. There is not a point with x and y that have the same z value. I could just search the 3D points that have the x and y if I am looking at it from a top down view. But, is there a way to find the 3D point for more complex views?

– Josue
Jan 5 at 11:31













In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

– tch
Jan 6 at 3:40





In general as long as two points don't map to the same point when projected you can come back by searching your list of 3D points.

– tch
Jan 6 at 3:40




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • 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%2fstackoverflow.com%2fquestions%2f54006357%2fhow-to-convert-back-points-in-2d-to-3d-with-known-orthogonal-camera-projection%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

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas