Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-10-05 12:40:22 +0300
committerBastien Montagne <bastien@blender.org>2020-10-05 12:47:32 +0300
commit7e836bde11ce6521953c9f246cacd442a3ef6c0e (patch)
treeec25f85da60cb3b6e7fbbc1b4373960c99757cb8
parent0026ca09defb26b4137ac66a94d1ba757239aa32 (diff)
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.
-rw-r--r--intern/libmv/libmv/simple_pipeline/bundle.cc4
-rw-r--r--intern/libmv/libmv/simple_pipeline/camera_intrinsics.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/intern/libmv/libmv/simple_pipeline/bundle.cc b/intern/libmv/libmv/simple_pipeline/bundle.cc
index c055846318a..4e76ae1f473 100644
--- a/intern/libmv/libmv/simple_pipeline/bundle.cc
+++ b/intern/libmv/libmv/simple_pipeline/bundle.cc
@@ -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,
diff --git a/intern/libmv/libmv/simple_pipeline/camera_intrinsics.h b/intern/libmv/libmv/simple_pipeline/camera_intrinsics.h
index cf0bdb76ccb..60ad1b5b8de 100644
--- a/intern/libmv/libmv/simple_pipeline/camera_intrinsics.h
+++ b/intern/libmv/libmv/simple_pipeline/camera_intrinsics.h
@@ -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,