Throw exception at counting registered images when an image in the frame does not exist in the reconstruction. #3546
Conversation
|
I may have misunderstood the issue before, but I don't think we should support images in frames that are not part of the reconstruction. What's the use case for this? |
There are no explicit use cases. The fix is more for the completeness of the reconstruction data structure, since there is no way to enforce that the images in the frames are all added in our current design. We don't want NumRegImages() and RegImageIds() to be broken in certain state of reconstruction object. |
|
So this is a safety improvement, similar to the previous two PRs. |
|
I'd rather have an exception thrown when the images were not added rather than silently skipping over those images, as implemented in this PR... If we want to add some extra safety, we could do another loop in the Reconstruction::Load() method to check that all images in the frames actually exist? |
Since we expose the Reconstruction class to public, |
|
Because |
|
Yeah, I understand, but then somebody is misusing the contract. Silently ignoring errors in the setup is not the right solution. Let's make sure, if somebody misconfigures the reconstruction, they will see a meaningful error message. I thought your previous PRs would address this? |
Yes. Most of the errors are addressed by my previous PRs, except for that we cannot check whether all images in the frame are added, because |
Thanks, I think that is fine as long as subsequent operations on the reconstruction / frame / image objects lead to obvious errors, so people can fix the issue. The constraints in the SQLite schema should already prevent this when people manually populate objects in the database. |
Should I then change all the "continue;" in this PR to throwing exceptions? |
|
I don't think that adds any value. The |
|
The only place where it could be useful is where we count/accum the registered images? |
|
Sure. Then i will just throw at |
Done. PTAL : ) |
…ame does not exist in the reconstruction. (colmap#3546) Follow up to colmap#3540 and colmap#3543 --------- Co-authored-by: Johannes Schönberger <jsch@demuc.de>
Follow up to #3540 and #3543