Skip to content

Commit 396d82c

Browse files
authored
Merge pull request #1768 from alicevision/fix/bugBootstraping
[pipeline] sfmBootstraping: Fix inversion between min and max
2 parents ca8300f + 1161458 commit 396d82c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/aliceVision/sfm/pipeline/expanding/ExpansionChunk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool ExpansionChunk::process(sfmData::SfMData & sfmData, const track::TracksHand
2222
return false;
2323
}
2424

25-
//#pragma omp parallel for
25+
#pragma omp parallel for
2626
for (int i = 0; i < viewsChunk.size(); i++)
2727
{
2828
auto it = viewsChunk.begin();

src/software/pipeline/main_sfmBootstraping.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ int aliceVision_main(int argc, char** argv)
221221
// user optional parameters
222222
const double maxEpipolarDistance = 4.0;
223223
const double minAngle = 5.0;
224+
const double maxAngle = 40.0;
224225

225226
int randomSeed = std::mt19937::default_seed;
226227

@@ -309,6 +310,11 @@ int aliceVision_main(int argc, char** argv)
309310
continue;
310311
}
311312

313+
if (radianToDegree(angle) > maxAngle)
314+
{
315+
continue;
316+
}
317+
312318
//If the angle is too small, then dramatically reduce its chances
313319
if (radianToDegree(angle) < minAngle)
314320
{
@@ -324,7 +330,8 @@ int aliceVision_main(int argc, char** argv)
324330
double refScore = sfm::ExpansionPolicyLegacy::computeScore(tracksHandler.getAllTracks(), usedTracks, pair.reference, maxref, 5);
325331
double nextScore = sfm::ExpansionPolicyLegacy::computeScore(tracksHandler.getAllTracks(), usedTracks, pair.next, maxnext, 5);
326332

327-
double score = std::min(refScore, nextScore) * std::min(10.0, radianToDegree(angle));
333+
double score = std::min(refScore, nextScore) * std::max(1.0, radianToDegree(angle));
334+
328335

329336
if (score > bestScore)
330337
{

0 commit comments

Comments
 (0)