How to find rotation matrix from 4 rectangle points
조회 수: 13 (최근 30일)
이전 댓글 표시
Hi,
I have 4 3d points(x, y, z). Using these points how can I calculate rotation angle? Consequently, I want to have a 4x4 transformation matrix including rotation and translation information.
4 points are in a plane and they are corners of rectangle and I set the top-left point as the origin of the rectangle coordinate. Look at the bellow pictures.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/306059/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/306063/image.png)
Here I only have four 3D points(Xw,Tw,Zw) based on the world coordinate. According to the 4 points, I can calculate 4 points based on the rectangle coordinate. For instance, value [Xr] in P2 is the distance between P1 and P2. And [-Yr] in P3 is the distance between P1 and P3.
Then how could I get rotation angle of the rectangle based on the world coordinate using those information?
Additional information (3d points in the world coordinate):
P1(-401.428, 485.929, 772.921)
P2(-21.4433, 475.611, 772.511)
P3(-400.982, 483.56, 403.703)
P4(-21.589, 473.028, 403.242)
댓글 수: 0
채택된 답변
Image Analyst
2020년 5월 30일
Wouldn't the rotation matrix be
rotMatrix = pDistorted \ pStraight
댓글 수: 4
Image Analyst
2020년 6월 3일
Again: "what do you want your transformed data coordinates to be?" You gave only input coordinates, not output coordinates.
Blog entry that might be useful: http://blogs.mathworks.com/steve/2006/08/04/spatial-transformations-defining-and-applying-custom-transforms/
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cartesian Coordinate System Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!