hbb1 / 2d-gaussian-splatting

[SIGGRAPH'24] 2D Gaussian Splatting for Geometrically Accurate Radiance Fields
https://surfsplatting.github.io
Other
2.03k stars 135 forks source link

render.py 生成的是点云文件,目前有方法可以转成obj或者fbx吗 #112

Open liu19951002 opened 3 months ago

DabblerGISer commented 3 months ago

it is possible to use meshlab to convert faces and colors into meshes and texture. meshlab also provides python lib.

glorioushonor commented 3 months ago

it is possible to use meshlab to convert faces and colors into meshes and texture. meshlab also provides python lib.

Could you please show how to export texture files using MeshLab? Currently, I can only export to OBJ format using the following command line, but I don't know how to export the textures. meshlabserver -i fuse_post2.ply -o fuse_post2.obj -m vc vn

DabblerGISer commented 3 months ago

it is possible to use meshlab to convert faces and colors into meshes and texture. meshlab also provides python lib.

Could you please show how to export texture files using MeshLab? Currently, I can only export to OBJ format using the following command line, but I don't know how to export the textures. meshlabserver -i fuse_post2.ply -o fuse_post2.obj -m vc vn

I'm using pymeshlab. basically there are two steps: firstly, run compute_texcoord_parametrization_triangle_trivial_per_wedge, and then run transfer_attributes_to_texture_per_vertex.

this is how I did: ms = pymeshlab.MeshSet() ms.load_new_mesh('yourpath to ply mesh') ms.compute_texcoord_parametrization_triangle_trivial_per_wedge(textdim='define by yourself') impath = 'your path to save the texture image' ms.transfer_attributes_to_texture_per_vertex(textw=(corresponding to the textdim), texth=(corresponding to the textdim), textname='./texture.png')

try:
    ms.save_current_mesh('your path to save obj')
except:
    MeshSet = ms[0]
    text = MeshSet.textures()
    internal = text[impath]
    internal.save(impath)
glorioushonor commented 3 months ago

@DabblerGISer Thanks for your kind reply. I have successfully obtained the texture map with your guidance. However, during the process, the following error occurred:

Failed to apply filter: compute_texcoord_parametrization_triangle_trivial_per_wedge
Details: Inter-Triangle border is too much.

Due to this, I had to reduce the number of points. ms.meshing_decimation_quadric_edge_collapse(targetfacenum=70000) Although it ran successfully, the quality of the final generated OBJ file significantly decreased. Could you please provide any suggestions on this matter?

codetea-fly commented 3 months ago

@DabblerGISer Thanks for your kind reply. I have successfully obtained the texture map with your guidance. However, during the process, the following error occurred:

Failed to apply filter: compute_texcoord_parametrization_triangle_trivial_per_wedge
Details: Inter-Triangle border is too much.

Due to this, I had to reduce the number of points. ms.meshing_decimation_quadric_edge_collapse(targetfacenum=70000) Although it ran successfully, the quality of the final generated OBJ file significantly decreased. Could you please provide any suggestions on this matter?

You can increase the dimension

glorioushonor commented 3 months ago

@DabblerGISer Thanks for your kind reply. I have successfully obtained the texture map with your guidance. However, during the process, the following error occurred:

Failed to apply filter: compute_texcoord_parametrization_triangle_trivial_per_wedge
Details: Inter-Triangle border is too much.

Due to this, I had to reduce the number of points. ms.meshing_decimation_quadric_edge_collapse(targetfacenum=70000) Although it ran successfully, the quality of the final generated OBJ file significantly decreased. Could you please provide any suggestions on this matter?

You can increase the dimension

Yeah, you are right. Thanks. However, the texture of the generated OBJ file seems much darker than that of the PLY file, and I am unsure of the reason.