Skip to content

Commit

Permalink
fix sfmMerge
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Feb 17, 2025
1 parent 9423b4c commit a854ffe
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/software/utils/main_sfmMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,38 @@ bool simpleMerge(sfmData::SfMData & sfmData1, const sfmData::SfMData & sfmData2)
if (!(obj1 == obj2))
{
ALICEVISION_LOG_ERROR("Unhandled error: common intrinsic ID with different parameters between both SfMData");
return false;
}
}
}

intrinsics1.insert(intrinsics2.begin(), intrinsics2.end());
}

{
auto& rigs1 = sfmData1.getRigs();
auto& rigs2 = sfmData2.getRigs();
const size_t totalSize = rigs1.size() + rigs2.size();

rigs1.insert(rigs2.begin(), rigs2.end());
if (rigs1.size() < totalSize)
//If both sfm share a common rigid
//Make sure there is no ambiguity and the content is the same
for (const auto & [key, rig] : rigs1)
{
ALICEVISION_LOG_ERROR("Unhandled error: common rigs ID between both SfMData");
return false;
const auto & itRigOther = rigs2.find(key);
if (itRigOther != rigs2.end())
{
const auto & obj1 = rig;
const auto & obj2 = itRigOther->second;

if (!(obj1 == obj2))
{
ALICEVISION_LOG_ERROR("Unhandled error: common rig ID with different parameters between both SfMData");
return false;
}
}
}

rigs1.insert(rigs2.begin(), rigs2.end());
}

{
Expand Down

0 comments on commit a854ffe

Please sign in to comment.