diff --git a/src/aliceVision/fuseCut/GraphFiller.cpp b/src/aliceVision/fuseCut/GraphFiller.cpp index 8153743172..cce0456fd6 100644 --- a/src/aliceVision/fuseCut/GraphFiller.cpp +++ b/src/aliceVision/fuseCut/GraphFiller.cpp @@ -121,6 +121,11 @@ void GraphFiller::rayMarchingGraphEmpty(int vertexIndex, assert(cam >= 0); assert(cam < _mp.ncams); + + if (_camsVertexes[cam] < 0) + { + return; + } // Initialisation GeometryIntersection geometry(vertexIndex); // Starting on global vertex index @@ -128,8 +133,6 @@ void GraphFiller::rayMarchingGraphEmpty(int vertexIndex, // toTheCam const double pointCamDistance = (_mp.CArr[cam] - originPt).size(); - - TetrahedronsRayMarching marching(_tetrahedralization, vertexIndex, _camsVertexes[cam], false); Facet lastIntersectedFacet; @@ -200,6 +203,14 @@ void GraphFiller::rayMarchingGraphFull(int vertexIndex, float fullWeight, double nPixelSizeBehind) { + assert(cam >= 0); + assert(cam < _mp.ncams); + + if (_camsVertexes[cam] < 0) + { + return; + } + const int maxint = std::numeric_limits::max(); const Point3d& originPt = _verticesCoords[vertexIndex]; const double pixSize = _verticesAttr[vertexIndex].pixSize; @@ -295,7 +306,11 @@ void GraphFiller::forceTedgesByGradientIJCV(float nPixelSizeBehind) GeometryIntersection geometry(vertexIndex); // Starting on global vertex index Point3d intersectPt = originPt; // toTheCam - + + if (_camsVertexes[cam] < 0) + { + continue; + } TetrahedronsRayMarching marching(_tetrahedralization, vertexIndex, _camsVertexes[cam], false);