nmoehrle / mvs-texturing

Algorithm to texture 3D reconstructions from multi-view stereo images
Other
974 stars 334 forks source link

Texrecon # of texture images #128

Closed eddienewton closed 4 years ago

eddienewton commented 4 years ago

Hey, I know this has been out there awhile, but it gives great results!

I had a question regarding reducing the number of texture maps created.

In generate_texture_atlases.cpp, it looks like the conditional on the waste variable is rather stringent. On some meshes, I'm seeing about 10 texture maps created. If I change the maximum ratio of waste to texture area to 10.0 (as such), I get a lot fewer texture maps.

if (static_cast<double>(waste) / texture_patch->get_size() > 10.0) { //use to be 1.0
    break;
}

Thoughts? Is there a better way to reduce the number of texture maps? I also had decent results with reducing the padding shift from 7 to 8.

Thanks.

nmoehrle commented 4 years ago

Theoretically there is no right amount of padding, padding merely allows for a certain amount of mip mapping levels to be generated without blending the different texture patches together. Depending on the application different values can be sufficient.

The number of texture atlases is trade off between size of the individual atlases (which would translate into texture memory on the graphics card) and amount of atlases (which typically translates into draw calls). When I wrote this I was mostly concerned with the size thus the stringent threshold on the wasted pixels.

Changing the texture packing algorithm cloud lead to a significant reduction in size and amount of atlases, the current implementation approximates all patches by their bounding box and is therefore not able to use all available space.

I would be happy to point send you a paper of an horizon based algorithm that can pack the patches tighter together.

Best wishes, Nils

KevinLee752 commented 4 years ago

Hi, I'm also working on this issue recently and hoping to get only one texture map. Thanks for the excellent work and answering in time. So is there some thing new I can try to do this? Or can I please get the paper of horizon based algorithm you mentioned above?