nmoehrle / mvs-texturing

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

bugfix border condition for texturing holes #123

Closed christianachilleszeisscom closed 4 years ago

christianachilleszeisscom commented 4 years ago

The mesh parameterization for mapping texture holes is done by solving a linear equation using some barycentric weights. However the coords used to calculate b (in Ax=b) were permutated.

Explanation of issue and fix:

--> border[idx[something]] is clearly messing up indices and produces wrong positions. Esp the distances to border-vertices are wrong. so the whole inner part is twisted, rotated and overlapping, even worse for bigger holes.

What you really want is mapping local to global indices, for which a nice mapping already existed. One can even resolve all the mapping.

christianachilleszeisscom commented 4 years ago

Some snapshots from texture space: comparison

nmoehrle commented 4 years ago

Thank you very much for your interest and deep dive into the code. It is a while ago that I worte it and I don't quite get the index mixup yet. I am currently on vacation and have no computer for the next two weeks but I will look into this as soon as I am home. As far as I remember the idx should map from local vertex indices to the row/col of the matrix for all non for border vertices and to the border for all border vertices. So I think the conversion was correct. Did I miss something?

nmoehrle commented 4 years ago

Oh sorry you are absolutely right idx is not mapping into the border vector and it->first is already a local vertex index. Sorry you had to go through that, thank you!