Updated Export Raster Layers to MeshLab (markdown)

matlabbe
2025-04-13 15:03:13 -07:00
parent ddfff0db5f
commit a793ec81b0
+12
@@ -16,11 +16,13 @@ https://www.youtube.com/watch?v=N3YlncWbMto
5. Click on "Download all clouds (update cache)". Click `OK` for "Global map optimized". In the 3D Map view, you should see the point cloud like this:
![Point cloud without SBA](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/without_sba.png)
6. **Optional** We will do a post-processing of the map to make it more straight. To do that, click on Tools->"Post-processing...". Set the parameters as below and click `OK`. Sparse Bundle Adjustment (SBA) will optimize the map with the camera positions and the matching visual features between the cameras. You will then get the point cloud as the third image. In some cases, the results may be worst with SBA, to revert post-processing, just click on Edit->"Download graph only" (with global optimized option). Detecting more loop closures give generally good results. If the environment has a lot of geometry, you can refine the links with ICP.
![Post-processing dialog](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/sba_dialog.jpeg)
![Post-processing progress](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/sba_progress.jpeg)
![Point cloud with SBA](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/with_sba.png)
7. We will now export the cameras. To limit the number of cameras exported, open the Preferences menu and under 3D Rendering, set the node filtering parameters as this and click "OK" (note that in latest versions, it is called "Pose filtering" under Cloud Filtering panel):
![Filtering cameras](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/filtering_cameras.jpeg)
8. Click on File->"Export cameras in Bundler format (*.out)..."
@@ -28,12 +30,15 @@ https://www.youtube.com/watch?v=N3YlncWbMto
10. On older versions, you will be asked to export the cloud/mesh, press "No" as we will export the mesh using more cameras in the next steps. Now you should have the `bundler` directory filled with `cameras.out`, `list.txt` and `images` directory.
11. Open Preferences dialog again under 3D Rendering panel and uncheck "Node filtering", then press "OK":
![No filtering](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/no_filtering.jpeg)
12. Click on File->"Export 3D clouds...". Restore settings, then configure the Export 3D clouds dialog like this:
![Export mesh dialog](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/export_mesh_dialog.jpeg)
13. Wait until the generation of the mesh is done and save it (`mesh.ply`) in the `bundler` directory created previously:
![Export mesh](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/export_mesh.jpeg)
## Import in MeshLab
@@ -42,25 +47,32 @@ https://www.youtube.com/watch?v=N3YlncWbMto
3. In the "Open project file" dialog, select `cameras.out` inside the exported directory above.
4. In the "Open image list file" dialog, select the `list.txt`.
5. Click "Import mesh" and select the `mesh.ply` generated by RTAB-Map:
![Meshlab import](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/meshlab_imported.jpeg)
6. Generating a texture requires that the model has only "manifold" edges. So remove them by clicking on Filters->Selection->"Select non-Manifold Edges", then click "Apply" and click on button "Delete current selected vertices..." (the one in the yellow circle below):
![Menu manifold](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/menu_manifold.jpeg)
7. Generate the texture by clicking on Filters->Texture->"Parametrization+texturing from registered rasters":
![Menu texture](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/menu_texture.jpeg)
8. On the texture dialog, I just changed texture size to 2048 so have more resolution then press "Apply". Depending on your GPU, you could even create a larger texture (my laptop MeshLab crashes with a size of 4096 for example). You can see this [video](https://www.youtube.com/watch?v=OJZRuIzHcVw) for more info.
![Create texture](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/create_texture.jpeg)
9. On latest MeshLab version, the texture is applied on the mesh directly when the generation is completed.
10. To correctly see the texture on the mesh, you can turn off shading (click "None" on right panel):
![Color per face](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/color_face.jpeg)
11. Here some results (without and with texture):
![Desks without texture](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/desk_no_tex.jpeg)
![Desks with texture](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/desk_tex.jpeg)
12. You can show the cameras by clicking Render->"Show Camera". You can see this [video](https://www.youtube.com/watch?v=7yeSqH1ftT4) for more info.
![Show cameras](https://raw.githubusercontent.com/wiki/introlab/rtabmap/doc/Tutorials/Texture/show_cameras.jpeg)