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

Fixing meshroom_photogrammetry --input cameras.sfm behaviour #537

Closed
wants to merge 3 commits into from

Conversation

pocketpixels
Copy link

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()

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()
@@ -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):
Copy link
Member

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 ?

Copy link
Member

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

Suggested change
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 point cameraInit already has the views and intrinsics
  • if image is passed at this point we can read the rest of unresolved images (buildIntrinsics) and update cameraInit (cameraInit.*.value = ...)
  • otherwise nothing else need to be done

Copy link
Author

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.

Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants