Skip to content

Commit 2e73eeb

Browse files
author
Fabien Servant
committed
Early exit if no resections were a success
1 parent a1ce257 commit 2e73eeb

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ bool ExpansionChunk::process(sfmData::SfMData & sfmData, const track::TracksHand
3232
return false;
3333
}
3434

35+
//How many views to resect ?
36+
size_t countToProcess = 0;
37+
for (const IndexT viewId : viewsChunk)
38+
{
39+
if (!sfmData.isPoseAndIntrinsicDefined(viewId))
40+
{
41+
countToProcess++;
42+
}
43+
}
44+
3545

3646
struct IntermediateResectionInfo
3747
{
@@ -74,6 +84,17 @@ bool ExpansionChunk::process(sfmData::SfMData & sfmData, const track::TracksHand
7484
}
7585
}
7686

87+
//Early exit if no valid resections
88+
if (intermediateInfos.size() == 0)
89+
{
90+
//If no resection to do, then maybe we want to force recomputation
91+
if (countToProcess > 0)
92+
{
93+
ALICEVISION_LOG_INFO("ExpansionChunk::process early end");
94+
return false;
95+
}
96+
}
97+
7798
//Check that at least one view has rich info
7899
int richViews = 0;
79100
for (const auto & item : intermediateInfos)

0 commit comments

Comments
 (0)