Skip to content

Commit

Permalink
remove sfmBootstraping bug
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Oct 28, 2024
1 parent ca8300f commit 1161458
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/aliceVision/sfm/pipeline/expanding/ExpansionChunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool ExpansionChunk::process(sfmData::SfMData & sfmData, const track::TracksHand
return false;
}

//#pragma omp parallel for
#pragma omp parallel for
for (int i = 0; i < viewsChunk.size(); i++)
{
auto it = viewsChunk.begin();
Expand Down
9 changes: 8 additions & 1 deletion src/software/pipeline/main_sfmBootstraping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ int aliceVision_main(int argc, char** argv)
// user optional parameters
const double maxEpipolarDistance = 4.0;
const double minAngle = 5.0;
const double maxAngle = 40.0;

int randomSeed = std::mt19937::default_seed;

Expand Down Expand Up @@ -309,6 +310,11 @@ int aliceVision_main(int argc, char** argv)
continue;
}

if (radianToDegree(angle) > maxAngle)
{
continue;
}

//If the angle is too small, then dramatically reduce its chances
if (radianToDegree(angle) < minAngle)
{
Expand All @@ -324,7 +330,8 @@ int aliceVision_main(int argc, char** argv)
double refScore = sfm::ExpansionPolicyLegacy::computeScore(tracksHandler.getAllTracks(), usedTracks, pair.reference, maxref, 5);
double nextScore = sfm::ExpansionPolicyLegacy::computeScore(tracksHandler.getAllTracks(), usedTracks, pair.next, maxnext, 5);

double score = std::min(refScore, nextScore) * std::min(10.0, radianToDegree(angle));
double score = std::min(refScore, nextScore) * std::max(1.0, radianToDegree(angle));


if (score > bestScore)
{
Expand Down

0 comments on commit 1161458

Please sign in to comment.