isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.43k stars 2.31k forks source link

Generate vertex colors #3455

Closed mxf8bv closed 3 years ago

mxf8bv commented 3 years ago

Hi,

I want to use registration_colored_icp as a replacement for standard ICP. For this, I obviously need vertex colors.

I have reference mesh files with textured surfaces and I can load them and transfer into a PointCloud using the mesh.vertex_color field. Unfortunately, my model files don't have colored vertices set, so the result is uniformly colored and not useful.

Question: How can I assign vertex colors from textures? E.g., using the mean color of adjacent textured faces? In Meshlab, for example, there is a filter to do this: Filter->Texture->Transfer:TextureToVertexColor. This works but I need to do this programatically for many models in o3d.

BTW, I found that using python and o3d 0.10, 0.11, and 0.12 crashes with a segfault and no error message when calling registration_colored_icp with PointClouds that don't have colors (has_colors()==False).

Thx! Mathias

reyanshsolis commented 3 years ago

Hi @mxf8bv, thanks for reporting the bug, PR #3466 may fix it. Regarding the requested feature, I may try to add the same in a future PR.

Thanks, Rishabh

mxf8bv commented 3 years ago

Hi Rishabh,

thanks for the answer! Looking forward for such a feature!

Is there any documentation on how o3d performs the UV mapping of the texture onto the geometry so that I could hack something in the meantime?

Best, Mathias