Projection of 3D points on plane

조회 수: 14 (최근 30일)
Ralf Becker
Ralf Becker 2022년 3월 9일
댓글: Ralf Becker 2022년 3월 12일
Hello, my name is Ralf and I work in a neurosurgical clinic. For a research project I am trying to project a 3D point cloud onto a calculated plane, which I found with the function mentioned below. But now I am not able (with also some limited mathematical knowledge) to find out how to project the original points onto the found plane, so that the original distances between the points are kept as correct as possible. The goal would be again a matrix with the points / the coordinates, which I can then take for example for the calculation of a convexhull. If someone has a tip or a link to a solution I would be very grateful. In my research, I could not find anything clear and in particular I fail in how to deal with the plane, which is determined by pcfitplane, or how I can access the individual points of this plane again.
Thank you so much for your help!
Greetings,
Ralf
Code:
M = readmatrix("file.txt");
x = M(:,1);
y = M(:,2);
z = M(:,3);
PTC = pointCloud(M)
MD = 5;
[model1, inlierI, outlierI] = pcfitplane(PTC,MD)
plane = select(PTC,inlierI)
rest = select(PTC,outlierI)
figure
pcshow(plane)
figure
pcshow(rest)

답변 (1개)

John D'Errico
John D'Errico 2022년 3월 9일
편집: John D'Errico 2022년 3월 9일
Why do you think the original distances between the points should be the same after a projection? NOT SO!!!!!!! In fact, it is trivial to give a counter-example. Consider this trivial case.
I'll work in 2-dimensions, so it will be trivial to see what happens and to show why your goal is impossible.
The projection plane will be the line x+y == 0. It has a slope of -1, and passes through the origin.
Now, consider the points at {(-1,-1), (-10,-10), (1,1), (10,10)}.
Do you see they all lie along the line y - x == 0? In fact, the interesting thing is the orthogonal projection to the line of interest just happens to leave them all at the origin. ALL four points project onto the origin. So while they were originally fairly distance from each other, after the orthogonal projection, they all lie at EXACTLY the same point. The distance after projection is now ZERO.
(Do I really need to do the mathematics here?)
The original distance between points has little to do with the distances between points after projection. If you think there should be some way to do the projection so that is not the case, then you would be wrong. An orthogonal projection is actually a pretty simple thing, and there are not many ways you can do it.
  댓글 수: 3
John D'Errico
John D'Errico 2022년 3월 11일
Yes, but that is part of my point. Accuracy of reproducing the original distances is irrelevant. If you are going to do an orthogonal projection onto a plane, then there is only one way to accomplish the projection. The points end up where they must go, because the orthogonal projection is a well-posed operation. There is no potential ambiguity.
What matters is only the normal vector to the plane, nothing else. If the original distance between two points has a large component in the direction of that normal vector, then that component disappears after projection. This is not something where any choice is made. You project the points, and they end up where you sent them, regardless of your desire.
Ralf Becker
Ralf Becker 2022년 3월 12일
That seems conclusive, thank you. However, do you have a tip on how to access the points in the plane I received via the function pcfitplane? Like how could I perform a convex hull on this result in the code mentioned above?
Thank you so much for your answer!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by