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]
Josue
  • 11
  • 2

1 Answers1

1

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.

overfull hbox
  • 747
  • 3
  • 10
  • 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 05 '19 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. – overfull hbox Jan 06 '19 at 03:40