diff --git a/libs/MVS/DepthMap.cpp b/libs/MVS/DepthMap.cpp index 99fc24643..4ae4ef36e 100644 --- a/libs/MVS/DepthMap.cpp +++ b/libs/MVS/DepthMap.cpp @@ -74,7 +74,7 @@ DEFVAR_OPTDENSE_uint32(nMinViews, "Min Views", "minimum number of agreeing views MDEFVAR_OPTDENSE_uint32(nMaxViews, "Max Views", "maximum number of neighbor images used to compute the depth-map for the reference image", "12") DEFVAR_OPTDENSE_uint32(nMinViewsFuse, "Min Views Fuse", "minimum number of images that agrees with an estimate during fusion in order to consider it inlier", "2") MDEFVAR_OPTDENSE_uint32(nMaxViewsFuse, "Max Views Fuse", "maximum number of neighbor depth-maps used during fusion", "32") -DEFVAR_OPTDENSE_uint32(nMinViewsFilter, "Min Views Filter", "minimum number of images that agrees with an estimate in order to consider it inlier", "2") +DEFVAR_OPTDENSE_uint32(nMinViewsFilter, "Min Views Filter", "minimum number of images that agrees with an estimate in order to consider it inlier", "1") MDEFVAR_OPTDENSE_uint32(nMinViewsFilterAdjust, "Min Views Filter Adjust", "minimum number of images that agrees with an estimate in order to consider it inlier (0 - disabled)", "1") MDEFVAR_OPTDENSE_uint32(nMinViewsTrustPoint, "Min Views Trust Point", "min-number of views so that the point is considered for approximating the depth-maps (<2 - random initialization)", "2") MDEFVAR_OPTDENSE_uint32(nNumViews, "Num Views", "Number of views used for depth-map estimation (0 - all views available)", "0", "4", "8") diff --git a/libs/MVS/SceneDensify.cpp b/libs/MVS/SceneDensify.cpp index 96f321d30..d3764a49d 100644 --- a/libs/MVS/SceneDensify.cpp +++ b/libs/MVS/SceneDensify.cpp @@ -924,14 +924,10 @@ bool DepthMapsData::FilterDepthMap(DepthData& depthDataRef, const IIndexArr& idx // count valid neighbor depth-maps ASSERT(depthDataRef.IsValid() && !depthDataRef.IsEmpty()); - const IIndex N = idxNeighbors.GetSize(); + const IIndex N = idxNeighbors.size(); ASSERT(OPTDENSE::nMinViewsFilter > 0 && scene.nCalibratedImages > 1); - const IIndex nMinViews(MINF(OPTDENSE::nMinViewsFilter,scene.nCalibratedImages-1)); - const IIndex nMinViewsAdjust(MINF(OPTDENSE::nMinViewsFilterAdjust,scene.nCalibratedImages-1)); - if (N < nMinViews || N < nMinViewsAdjust) { - DEBUG("error: depth map %3u can not be filtered", depthDataRef.GetView().GetID()); - return false; - } + const IIndex nMinViews(MINF(OPTDENSE::nMinViewsFilter, N)); + const IIndex nMinViewsAdjust(MINF(OPTDENSE::nMinViewsFilterAdjust, N)); // project all neighbor depth-maps to this image const DepthData::ViewData& imageRef = depthDataRef.images.First();