Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e.

Current libmv_modal_solver_test fails since rB3a7d62cd1f5e.

It appears that the issue is caused by the insertion of the new OFFSET_K4 parameter,
as, if camera intrinsics are not required to implement/use all of those deform
parameters, they absolutely have to keep order (values) matching those defined
in bundle.cc, otherwise `PackIntrinisicsIntoArray` and `UnpackIntrinsicsFromArray`
will mangle them around.
This commit is contained in:
Bastien Montagne 2020-10-05 11:40:22 +02:00
parent 0026ca09de
commit 7e836bde11
Notes: blender-bot 2023-07-10 10:12:37 +02:00
Referenced by commit 86138d88f6, Revert "Fix critical lens distortion bug in libmv after rB3a7d62cd1f5e."
2 changed files with 5 additions and 0 deletions

View File

@ -47,6 +47,10 @@ enum {
OFFSET_PRINCIPAL_POINT_Y,
// Distortion model coefficients.
// WARNING: camera intrinsics are not required to define/use all of those,
// but they have to define all of them up to the last one they need, in that
// exact same order. See e.g. how `PolynomialCameraIntrinsics` needs to define
// `OFFSET_K4`, even though it does not use it.
OFFSET_K1,
OFFSET_K2,
OFFSET_K3,

View File

@ -281,6 +281,7 @@ class PolynomialCameraIntrinsics : public CameraIntrinsics {
OFFSET_K1,
OFFSET_K2,
OFFSET_K3,
OFFSET_K4, // Unused, needed to map properly with all deform parameters defined in bundle.cc.
OFFSET_P1,
OFFSET_P2,