Transform scale rotate .obj to known values

5 views (last 30 days)
Hi all, I have some .obj files created through photogrammetry I’m looking to transform and rotate and scale to match known dimensions but I’m not really sure where to start. I’ve got about 3000 to process and each is slightly differently aligned so I can’t take that point 1,1,1 is the same in all. Oh and I’m limited to 2018b only due to company policy. Tim

Accepted Answer

Gowtham
Gowtham on 18 Dec 2023
Hello Tim,
I understand that you are trying to perform transformations such as rotation and scaling on the available OBJ files to align them properly.
This can be achieved by first converting the OBJ files to PLY format, then utilizing the Point Cloud Processing tools available in the Computer Vision Toolbox.
For a sample demonstration of the above process, kindly refer to the following steps:
  1. Use the Wavefront OBJ toolbox from the file exchange to read the OBJ files and gather necessary data such as vertices.
  2. Transform this data into PLY format using the 'plywrite' function, also available on the file exchange.
  3. Select a reference PLY file as your starting point.
  4. For each OBJ file that has been converted to a PLY file, load it using the 'pcread' function from Point Cloud Processing.
  5. Apply the 'pcregistericp' function to align two point clouds by employing a rigid transformation, which includes translation, rotation, and uniform scaling, based on their corresponding points.
  6. Save the transformed data back into PLY files using the 'pcwrite' function.
  7. Finally, these files can be accessed again using 'pcread' and visually inspected using 'pcshow'.
Kindly refer to the following MATLAB Documentations for further information on how to use the mentioned functions:
Hope this helps!
Best Regards,
Gowtham

More Answers (1)

tim pearce
tim pearce on 18 Dec 2023
Hi thats fabulus thankyou for the help
Kind Regards
Tim

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!