Transform 3D point cloud

1 vue (au cours des 30 derniers jours)
Ernest Porqueras
Ernest Porqueras le 17 Mar 2021
Réponse apportée : Omega le 30 Août 2024
I have a point cloud and an object with its own coordinate system matrix like this:
ref=[ -0.48664090 0.36675647 0.79288739;
-0.67601788 -0.73296887 -0.075871207;
-0.55333579 0.57292831 -0.60462612 ]
How can I transform the point cloud in order to align the object coordinate system with the global coordinate system?

Réponses (1)

Omega
Omega le 30 Août 2024
Hi Ernest,
To align the object's coordinate system with the global coordinate system, you need to apply a transformation to the point cloud using the inverse of the reference matrix. Here's how you can do it in MATLAB:
ref = [-0.48664090, 0.36675647, 0.79288739;
-0.67601788, -0.73296887, -0.075871207;
-0.55333579, 0.57292831, -0.60462612];
ref_inv = inv(ref);
transformedPointCloud = (ref_inv * pointCloud')';
"ref_inv" is the inverse of the reference matrix, which will be used to transform the point cloud. The "pointCloud" should be an Nx3 matrix where each row represents a point in the cloud. Make sure "pointCloud" is defined with your actual data before running this code.
Multiplying the inverse of the reference matrix by the point cloud aligns the object with the global coordinate system.

Community Treasure Hunt

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

Start Hunting!

Translated by