mapillary / mapillary/OpenSfM

Question baout how to calculate the relative rotation from between two shots.

Open
#814 3 comments 0 reactions 1 assignee View on GitHub

@fabianschenk is already working on this.

Since Nov 1, 2021.

question
Dominant language
Python
Stars
3.8k
Forks
899
PR merge metrics
No merged PRs in 30d

Description

Hello, opensfm is a great job, thank you. I use opensfm to reconstruct the camera position on a set of images.This group of pictures is taken by a fixed PTZ camera. The camera rotates around the yaw angle, takes 20 images, adjusts the pitch angle and repeats it three times. The reconstructed effect looks good, as shown in the following figure:
Screenshot from 2021-11-01 17-25-49_gaitubao_610x436
At this time, I want to calculate the relative rotation between the two images. The code is as follows.

    reconstruction = data.load_reconstruction()[0]
    mov_shot_pose = reconstruction.shots["20.jpg"].pose
    fixed_pose = reconstruction.shots["0.jpg"].pose
    relative_pose = mov_shot_pose.relative_to(fixed_pose)
    rotation_matrix = relative_pose.get_rotation_matrix()
    euler_angle = relative_pose.get_R_cam_to_world_min()

But this answer is wrong. I would like to ask how to calculate this relative rotation. Look forward to your reply.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.