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

Differences between json and camera param table #61

Open
ericleonardis opened this issue Dec 6, 2023 · 3 comments
Open

Differences between json and camera param table #61

ericleonardis opened this issue Dec 6, 2023 · 3 comments

Comments

@ericleonardis
Copy link

The relative camera pose that is described in the JSON (R and T) is not identical to the extrinsic matrix that is displayed in the camera param viewer in the GUI. What is the difference between the camera pose JSON and the extrinsic matrix? Even when I set them in the GUI to have the same reference camera, the parameters are different.

I was able to replicate the parameters JSON by taking the camera pose from the pkl file and then multiplied by the inverse of the reference camera. However, I have been unable to figure out how the extrinsic matrix is being calculated.

@felipe-parodi
Copy link

@ericleonardis Did you ever figure this out?

@ericleonardis
Copy link
Author

@felipe-parodi unfortunately not... I hope @oliver-batchelor replies some day :(

@CodeIsJustLikeMagic
Copy link

Here is how to get the extrinsics displayed in the camera param table:

from multical import tables
from multical.workspace import Workspace
from structs.struct import split_dict # py_structs < 1.0
import numpy as np

ws = Workspace.load("mypath/calibration.pkl")

_, calibs = split_dict(ws.calibrations)
calibration = calibs[1] # <-use the calibrated positions (1) or the initialization positions (0)

poses = calibration.camera_poses.pose_table
poses = tables.inverse(poses)

# adjust for master camera
masterindex = 0
inv = np.linalg.inv(poses.poses[masterindex])
final = poses._extend(poses = poses.poses @ np.expand_dims(inv,0))

print(final.poses)

I'm also struggeling to understand why there are differences between the json and the display. The extrinsics that are used to position the meshes for the 3d view (happens in moving_cameras.py) are difference once again.
I'm trying to import the extrinsics into unity to compare them with my simulated ground truth cameras but so far no luck.

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

No branches or pull requests

3 participants