# find the way to transfer 2D projection back to 3D

11 vues (au cours des 30 derniers jours)
Yu Li le 1 Avr 2024
Commenté : Yu Li le 1 Avr 2024
Hi:
I have a 3D line and I want to
1) project the 3D line to 2D space
2) perform analysis
3)transfer back to 3D
however I could not find the appropriate way in 3rd step.
for example, I have a line
A= [0.001 0.0001 -0.0004;0.002 0.0001 -0.0004];
I would like to project to X-Y plane based on normal vector
nv=[0,0,1];
to transfer the 3D line to 2D, I use command:
B=A*null(nv);
however when I want to transfer it back, I use command:
C=B*null(nv)';
C =
0.0010 0.0001 0
0.0020 0.0001 0
where C is different from A.
maybe the approach I'm using is not correct, my question is, is there any other better way, to make sure the transform from 3D and 2D is correct and robust?
Thanks!
Yu
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

John D'Errico le 1 Avr 2024
Modifié(e) : John D'Errico le 1 Avr 2024
The projection you used into the nullspace was correct, AND robust. However the inverse operation is less easy to perform. You need to understand what you are doing, what these operations do.
Start with the "line". In fact, this is not a line, but two points in a 3-d space, which connected, imply a line of infinite extent.
A= [0.001 0.0001 -0.0004;0.002 0.0001 -0.0004];
You want to project that line into a plane defined by the normal vector, here
N = [0 0 1];
In this case of course, the implied projection plane is just the (x,y) plane. So the projection is simple enough. You are correct that null(N) will perform the projection.
null(N)
ans =
0 -1
1 0
0 0
Ahat = A*null(N)
ans =
0.0001 -0.001
0.0001 -0.002
The result is a pair of points as rows of Ahat. This now lives in a 2-d projection plane. Note that the projection is not unique. It was arbitrarily chosen by null, which effectively mapped the triad (x,y,z) into the pair (y,-x). Effectively, that projection throws away all information about z, just tossing all that information into the proverbial bit bucket of mathematics.
Having done so, what happens when you want to do the reverse operation? What did I just tell you? YOU THREW IT ALL AWAY! That is to say, any information about z no longer exists in youe data!
The reverse operation, thus
Ahat*null(N)'
ans =
0.001 0.0001 0
0.002 0.0001 0
restores x and y, but all information about z no longer exists! YOU THREW IT AWAY! GONE. Bit bucket limbo. Nada remains about z.
Effectively what that operation does is to view the projection plane as now a plane in 3-dimensions. But it is still just that 2-d plane.
What goes into the bit bucket of mathematics stays in the bit bucket. You cannot recover 3-dimensional information content from 2-dimensional data. All you can do is return the 2-d data into a 2-dimensional subspace of that 3-d domain.
Hmm. Let me say this another way. I'll take a picture of you with my trusty Polaroid camera. In effect, I have reduced the all of the information content in that original 3-d domain into a single 2-d projection of that scene. But having done so, now you want to recover the entire 3-d domain from simply that picture of it, knowing only the view point where you stood while taking the picture. While a picture paints a thousand words, it ain't enough.
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Yu Li le 1 Avr 2024
Hi John:
I totally agree with you, yes the 3D information was throw away during the operation, so the technical approach I used here (null(N) and null(N)') is not good. thank you very much for your detail explannation.
seems like "makehgtform" function may provide me the approach https://www.mathworks.com/help/matlab/ref/makehgtform.html#d126e960299, I will try it.
Bests,
Yu

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by