nmoehrle / mvs-texturing

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

"Adjusting texture patches" and "Blending texture patches" consumes a lot of time #145

Open KeoChi opened 4 years ago

KeoChi commented 4 years ago

Hello! I use CGAL::Delaunay to construct 2.5d mesh of point cloud.

CGAL::Delaunay _delaunay;
std::vector<CGAL::Delaunay::Point> _delaunay_points;
loadPointCloud(_input_file, _delaunay_points);
_delaunay.insert(_delaunay_points.begin(), _delaunay_points.end());
writeMeshPly(_delaunay, _mesh_file);

Then I use mvs-texturing for the 2.5d mesh. Sometime it would take a long time in "Adjusting texture patches"(Took 4782.46s) and "Blending texture patches"(Took 4456.5s) The logs:

Building adjacency graph: 
        Adding edges 100%... done. (Took 0.181s)                                
  148460 total edges.
View selection:
  Building BVH from 5937 faces... done. (Took: 73 ms)
        Calculating face qualities 100%... done. (Took 43.952s)                
        Postprocessing face infos 100%... done. (Took 0.267s)                  
  Maximum quality of a face within an image: 102890
  Clamping qualities to 6441.55 within normalization.
  Writing data cost file... done.
  Optimizing:
    Time[s] Energy
  .......
  25 faces have not been seen
  .......
Generating texture patches:
  Running... done. (Took 20.603s)
  187 texture patches.
Running global seam leveling:
  Create matrices for optimization...  done.
  Lhs dimensionality: 53559 x 53559
  Calculating adjustments:
    Color channel 1: CG took 99 iterations. Residual is 9.9e-05
    Color channel 2: CG took 101 iterations. Residual is 9.74283e-05
    Color channel 0: CG took 101 iterations. Residual is 9.65088e-05
    Took 0.116 seconds
        Adjusting texture patches 100%... done. (Took 4782.46s)                   
Running local seam leveling:
        Blending texture patches 100%...done. (Took 4456.5s)        

What is the reason for this situation? Is it the reason for the delaunay mesh? Should I update the mvs-texturing code? Thank you!