Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfmMerge can merge Intrinsics #1815

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/software/utils/main_sfmMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,21 @@ bool simpleMerge(sfmData::SfMData & sfmData1, const sfmData::SfMData & sfmData2)
auto& intrinsics2 = sfmData2.getIntrinsics();
const size_t totalSize = intrinsics1.size() + intrinsics2.size();

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

if (!(obj1 == obj2))
{
ALICEVISION_LOG_ERROR("Unhandled error: common intrinsic ID with different parameters between both SfMData");
Copy link
Member

@fabiencastan fabiencastan Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for RIG, do not return directly if common rigs, few lines below.

}
}
}
}

Expand Down
Loading