Skip to content

Commit

Permalink
dense: adjust minimum views filter parameters for depth-map processing
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcseacave committed Dec 20, 2024
1 parent 641ebc6 commit 3e878b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion libs/MVS/DepthMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 3 additions & 7 deletions libs/MVS/SceneDensify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3e878b6

Please sign in to comment.