Translating RGB info from a bitmapped OBJ to PLY points?

Feel free to ask any question here
Post Reply
Stenrik
Posts: 6
Joined: Thu Jan 17, 2019 2:41 am

Translating RGB info from a bitmapped OBJ to PLY points?

Post by Stenrik »

I need to go from an mesh object with a bitmap to a PLY with colored points that correspond to the bitmap. Is it possible to transfer the RGB information from the bitmap to the vertices and then save that out as a colored point cloud?

I tried importing the textured OBJ into MeshLab, tranfering from bitmap to vertex color, and then exporting as a PLY with "color" selected under "vertex." I can then bring it into CloudCompare to export just the vertices as a pure cloud. However, the point colors come into Max as very light and "washed out" for some reason, even though they look fine in CloudCompare. I can't figure out why it's happening, though some kind of gamma correction is suspected. But I would prefer doing all the work in CloudCompare if possible.]

One on right is desired result, but one on left is the technique required for larger files.
Image

If CloudCompare could transfer that bitmap information to vertex points in a cloud directly, without any brightness shifts, that would be amazing!

[I have an existing workflow to go from textured mesh to colored point cloud without gamma shift problems, but it only works on SMALL files. (I can use a utility in 3DS Max to transfer the map to vertex color channel, then use a PLY export plugin to save out a PLY mesh file, then bring it into CloudCompare to select the vertices and save it out as a PLY point cloud. However, the export plugins I've tried within Max crash when exceeding a small file size (or take many, many hours to process it).
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Translating RGB info from a bitmapped OBJ to PLY points?

Post by daniel »

I don't think CC is doing any gamma correction, it just reads the raw RGB values, and in the worst case it applies the materials lighting parameters but this can only darken the colors).

Anyway, on option is to use directly the 'Edit > Mesh > Sample points' feature that is able to sample points (so it's not only the vertices, it's anywhere on the mesh) and this tool converts the texture color to RGB color.

Another option which could work is to use the 'Edit > Colors > Interpolate from another entity' on the vertices cloud (selecting the mesh entity as the other entity).
Daniel, CloudCompare admin
Stenrik
Posts: 6
Joined: Thu Jan 17, 2019 2:41 am

Re: Translating RGB info from a bitmapped OBJ to PLY points?

Post by Stenrik »

Hi Daniel,

Thanks for the quick reply, and verifying that CloudCompare is not doing any gamma adjustments. (Perhaps it's happening in Meshlab...)

Unfortunately, it's important that I sample only the vertices from the mesh for this project. So CloudCompare doesn't currently have a way of creating a cloud JUST from the vertices of a PLY mesh?

I tried the "interpolate from another entity" but it was grayed out no matter what I had selected (tried both the Mesh.sampled" version and the Vertices section of the original mesh object).
Stenrik
Posts: 6
Joined: Thu Jan 17, 2019 2:41 am

Re: Translating RGB info from a bitmapped OBJ to PLY points?

Post by Stenrik »

Just to follow up, I found there was a problem with the original mesh that was throwing off the UVs to cause this color disparity problem. CloudCompare wasn't a factor. :-)

Would love to see a "cloud from vertex" option in the future.
Post Reply