Skip to content

Commit

Permalink
[fustCut] Use the number of valid depths to define the step
Browse files Browse the repository at this point in the history
Instead of counting all input pixels, we select the steps based on the
number of valid depth values.
  • Loading branch information
fabiencastan committed Aug 25, 2023
1 parent b4e4568 commit 18e281b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/aliceVision/fuseCut/DelaunayGraphCut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,14 +1118,15 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector<int>& cams, const Po
// If too much points at the end, increment a coefficient factor on the pixel size
// and iterate to fuse points until we get the right amount of points.

// unsigned long nbValidDepths = computeNumberOfAllPoints(mp, 0);
// int stepPts = divideRoundUp(nbValidDepths, maxPoints);
const unsigned long nbValidDepths = computeNumberOfAllPoints(_mp, _mp.getProcessDownscale());
ALICEVISION_LOG_INFO("Number of all valid depths in input depth maps: " << nbValidDepths);
std::size_t nbPixels = 0;
for(const auto& imgParams: _mp.getImagesParams())
{
nbPixels += imgParams.size;
}
int step = std::floor(std::sqrt(double(nbPixels) / double(params.maxInputPoints)));
ALICEVISION_LOG_INFO("Number of pixels from all input images: " << nbPixels);
int step = std::floor(std::sqrt(double(nbValidDepths) / double(params.maxInputPoints)));
step = std::max(step, params.minStep);
std::size_t realMaxVertices = 0;
std::vector<int> startIndex(_mp.getNbCameras(), 0);
Expand All @@ -1145,7 +1146,6 @@ void DelaunayGraphCut::fuseFromDepthMaps(const StaticVector<int>& cams, const Po
int minAngleCounter = 0;

ALICEVISION_LOG_INFO("simFactor: " << params.simFactor);
ALICEVISION_LOG_INFO("nbPixels: " << nbPixels);
ALICEVISION_LOG_INFO("maxVertices: " << params.maxPoints);
ALICEVISION_LOG_INFO("step: " << step << " (minStep: " << params.minStep << ")");
ALICEVISION_LOG_INFO("realMaxVertices: " << realMaxVertices);
Expand Down

0 comments on commit 18e281b

Please sign in to comment.