-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fixing meshroom_photogrammetry --input cameras.sfm behaviour #537
Conversation
When meshroom_photogrammetry is called with the --input parameter pointing to a SFM file, then the camera intrinsics and poses are loaded from that file. In this case we should not call CameraInit.buildIntrinsics()
bin/meshroom_photogrammetry
Outdated
@@ -101,7 +101,8 @@ else: | |||
graph = multiview.photogrammetry(inputViewpoints=views, inputIntrinsics=intrinsics, output=args.output) | |||
cameraInit = getOnlyNodeOfType(graph, 'CameraInit') | |||
|
|||
views, intrinsics = cameraInit.nodeDesc.buildIntrinsics(cameraInit, images) | |||
if not (views and intrinsics): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or rather:
if images:
We still want to go through buildIntrinsics when we have "unresolved" input images (from args.inputImages), even when retrieving views and intrinsics from an pre-calibrated sfm file.
Is this okay for your use-case ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, now that #567 has been merged my suggestion is
if not (views and intrinsics): | |
if images: | |
views, intrinsics = cameraInit.nodeDesc.buildIntrinsics(cameraInit, images) | |
cameraInit.viewpoints.value = views | |
cameraInit.intrinsics.value = intrinsics |
because:
- whether a default or custom pipeline (
--pipeline
) is passed at this pointcameraInit
already has theviews
andintrinsics
- if
image
is passed at this point we can read the rest of unresolved images (buildIntrinsics
) and updatecameraInit
(cameraInit.*.value = ...
) - otherwise nothing else need to be done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like #567 should address the issue I had.
The issue being that the poses and intrinsics loaded from the SFM file would be discarded during initialization.
I do not know (and am unfortunately unable to test) whether the additional changes discussed above are still necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the proposed change looks reasonable to me.
When meshroom_photogrammetry is called with the --input parameter pointing to a SFM file, then the camera intrinsics and poses are loaded from that file. In this case we should not call CameraInit.buildIntrinsics()