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

Improve __repr__ for various objects #224

Merged
merged 19 commits into from
Jan 10, 2024
Merged

Improve __repr__ for various objects #224

merged 19 commits into from
Jan 10, 2024

Conversation

sarlinpe
Copy link
Collaborator

@sarlinpe sarlinpe commented Jan 6, 2024

Breaking changes:

  • Sim3d.from_matrix becomes a constructor Sim3d(matrix)
  • Camera.{model_id,model_name} are merged into Camera.model (via enum)
  • Camera.params_info and Image.{num_points2D,num_points3D} become read-only properties (previously: functions)

Samples:

>> camera
Camera(camera_id=1, model=SIMPLE_RADIAL, width=780, height=1063, params=[1245.950053, 390.000000, 531.500000, 0.020831] (f, cx, cy, k))

>> print(rec.cameras[1].summary())
Camera:
    camera_id = 1
    model = CameraModelId.SIMPLE_RADIAL
    width = 780
    height = 1063
    focal_length = 1245.950052502772
    focal_length_x = 1245.950052502772
    focal_length_y = 1245.950052502772
    has_prior_focal_length = False
    principal_point_x = 390.0
    principal_point_y = 531.5
    params_info = f, cx, cy, k
    params = [1.24595005e+03 3.90000000e+02 5.31500000e+02 2.08308406e-02]

>> image
Image(image_id=1, camera_id=1, name="mapping/02928139_3448003521.jpg", triangulated=760/2313)

>> print(image.summary())
Image:
    image_id = 1
    camera_id = 1
    name = mapping/02928139_3448003521.jpg
    cam_from_world = Rigid3d(quat_xyzw=[0.0500042, 0.243753, -0.155877, 0.955922], t=[-1.37836, 0.000488448, -1.59398])
    cam_from_world_prior = Rigid3d(quat_xyzw=[nan, nan, nan, nan], t=[nan, nan, nan])
    points2D = [ ... 2313 elements ... ]
    registered = True
    num_points2D = 2313
    num_points3D = 760
    num_observations = 0
    num_correspondences = 0

>> sim3d
Sim3d(scale=1, quat_xyzw=[0, 0, 0, 1], t=[0, 0, 0])

pycolmap/scene/camera.h Show resolved Hide resolved
pycolmap/scene/camera.h Outdated Show resolved Hide resolved
pycolmap/scene/camera.h Outdated Show resolved Hide resolved
pycolmap/scene/image.h Show resolved Hide resolved
pycolmap/sfm/incremental_triangulator.h Outdated Show resolved Hide resolved
pycolmap/geometry/bindings.h Show resolved Hide resolved
pycolmap/scene/camera.h Show resolved Hide resolved
@Phil26AT Phil26AT self-requested a review January 10, 2024 13:45
@sarlinpe sarlinpe merged commit 7a5888c into master Jan 10, 2024
6 checks passed
@sarlinpe sarlinpe deleted the sarlinpe/repr branch January 10, 2024 13:49
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.

None yet

2 participants