Skip to content
Permalink
Browse files
estimate_monocular_calobject_poses_Rt_tocam() handles out-of-bounds o…
…bservations

Sorta. This is a massive hack. Please somebody do this properly
  • Loading branch information
dkogan committed Mar 16, 2021
1 parent a8ff877 commit 6d78379
Showing 1 changed file with 10 additions and 0 deletions.
@@ -528,6 +528,16 @@ def estimate_monocular_calobject_poses_Rt_tocam( indices_frame_camera,

intrinsics_data_pinhole = intrinsics_data_input[:4].copy()

# Ugly hack. opencv solvePnP() function I'm using here assumes a pinhole
# model. But this function accepts stereographic data, so observations could
# be really wide; behind the camera even. I can't do much behind the camera,
# but I can accept wide observations by using a much smaller pinhole focal
# length than the stereographic one the user passed. This really shouldn't
# be hard-coded, and I should only adjust if observations would be thrown
# away. And REALLY I should be using a flavor of solvePnP that uses
# observation vectors intead of pinhole pixel observations
intrinsics_data_pinhole[..., :2] /= 2.

if not all([mrcal.lensmodel_metadata(m)['has_core'] for m in lensmodels]):
raise Exception("this currently works only with models that have an fxfycxcy core. It might not be required. Take a look at the following code if you want to add support")

0 comments on commit 6d78379

Please sign in to comment.