Skip to content

Commit

Permalink
Merge pull request #1447 from alicevision/dev/graphCutPostProsessing
Browse files Browse the repository at this point in the history
[Meshing] Fix to avoid small holes in the final mesh
  • Loading branch information
fabiencastan authored Jun 3, 2023
2 parents afcd397 + 419e0b6 commit 5dd1386
Showing 1 changed file with 1 addition and 30 deletions.
31 changes: 1 addition & 30 deletions src/aliceVision/fuseCut/DelaunayGraphCut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2721,36 +2721,7 @@ void DelaunayGraphCut::graphCutPostProcessing(const Point3d hexah[8], const std:
}
ALICEVISION_LOG_WARNING("Declare empty around camera centers: " << nbModifiedCells << " cells changed to empty within " << _cellIsFull.size() << " cells.");
}


// Set cells that have a point outside hexahedron as empty
if(hexah != nullptr)
{
int nbModifiedCells = 0;
Point3d hexahinf[8];
mvsUtils::inflateHexahedron(hexah, hexahinf, 1.001);
for(CellIndex ci = 0; ci < _cellIsFull.size(); ++ci)
{
if(isInvalidOrInfiniteCell(ci) || !_cellIsFull[ci])
continue;

const Point3d& pa = _verticesCoords[_tetrahedralization->cell_vertex(ci, 0)];
const Point3d& pb = _verticesCoords[_tetrahedralization->cell_vertex(ci, 1)];
const Point3d& pc = _verticesCoords[_tetrahedralization->cell_vertex(ci, 2)];
const Point3d& pd = _verticesCoords[_tetrahedralization->cell_vertex(ci, 3)];

if((!mvsUtils::isPointInHexahedron(pa, hexahinf)) ||
(!mvsUtils::isPointInHexahedron(pb, hexahinf)) ||
(!mvsUtils::isPointInHexahedron(pc, hexahinf)) ||
(!mvsUtils::isPointInHexahedron(pd, hexahinf)))
{
_cellIsFull[ci] = false;
++nbModifiedCells;
}
}
ALICEVISION_LOG_WARNING("Full cells with a vertex outside the BBox are changed to empty: " << nbModifiedCells << " cells changed to empty.");
}


if(doRemoveDust)
{
removeDust(minSegmentSize);
Expand Down

0 comments on commit 5dd1386

Please sign in to comment.