cvg / pixloc

Back to the Feature: Learning Robust Camera Localization from Pixels to Pose (CVPR 2021)
Apache License 2.0
730 stars 90 forks source link

Support for Colmap camera model FULL_OPENCV #40

Open jackokaiser opened 2 years ago

jackokaiser commented 2 years ago

Dear pixloc authors and developers,

Many thanks for providing such a high-quality package! Well done.

For our application, we are using a FULL_OPENCV camera model, which isn't supported by pixloc at the moment.

The FULL_OPENCV model is registered in utils/colmap.py, but it's missing from pixlib/geometry/wrappers.py, as well as from the actual undistortion in pixlib/geometry/utils.py and its jacobian. The FULL_OPENCV calibration model is an extension to the OPENCV model, with an higher-order polynomial: k3, k4, k5 and k6 follow p1 and p2.

It seems that adding support for higher degree polynomials in the undistortion code would be simple, but I'm not sure about the boundary condition - what would this become?

sarlinpe commented 2 years ago

Hi, thank you for your interest! I just found out about this recent WACV2022 paper that derives the maximum radius for more complex camera models. The solution is not trivial but they provide a Python implementation and needs to be computed only once per camera, thus can be cached (e.g. adding a Camera.maximum_radius method with @cached_property).

jackokaiser commented 2 years ago

nice, I'll check it out, thanks!