From 0ec75be1c6c166d97dfb713169e381977df1da21 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 26 Feb 2013 11:46:38 +0000 Subject: Camera tracking: support refining radial K1, K2 only This commits adds extra refirenment entry in the menu which is "K1, K2" and which will apparently refine only this distortion coefficients. This would be useful in cases when you know for sure focal length (which could be obtained from lens, EXIF and so) but not sure about how good you manual calibration is. Be careful tho, there're no internal constraints on this coefficients so distortion model could just screw up into insane values. --- extern/libmv/libmv-capi.cpp | 4 +++- extern/libmv/libmv/simple_pipeline/bundle.cc | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'extern/libmv') diff --git a/extern/libmv/libmv-capi.cpp b/extern/libmv/libmv-capi.cpp index 945bc0c879e..4d6b35b91f8 100644 --- a/extern/libmv/libmv-capi.cpp +++ b/extern/libmv/libmv-capi.cpp @@ -437,7 +437,9 @@ int libmv_refineParametersAreValid(int parameters) { LIBMV_REFINE_RADIAL_DISTORTION_K1 | LIBMV_REFINE_RADIAL_DISTORTION_K2)) || (parameters == (LIBMV_REFINE_FOCAL_LENGTH | - LIBMV_REFINE_RADIAL_DISTORTION_K1)); + LIBMV_REFINE_RADIAL_DISTORTION_K1)) || + (parameters == (LIBMV_REFINE_RADIAL_DISTORTION_K1 | + LIBMV_REFINE_RADIAL_DISTORTION_K2)); } static void libmv_solveRefineIntrinsics(libmv::Tracks *tracks, libmv::CameraIntrinsics *intrinsics, diff --git a/extern/libmv/libmv/simple_pipeline/bundle.cc b/extern/libmv/libmv/simple_pipeline/bundle.cc index 0dd930a5ceb..7502ca389c4 100644 --- a/extern/libmv/libmv/simple_pipeline/bundle.cc +++ b/extern/libmv/libmv/simple_pipeline/bundle.cc @@ -208,6 +208,9 @@ void BundleIntrinsicsLogMessage(int bundle_intrinsics) { } else if (bundle_intrinsics == (BUNDLE_FOCAL_LENGTH | BUNDLE_RADIAL_K1)) { LG << "Bundling f, k1."; + } else if (bundle_intrinsics == (BUNDLE_RADIAL_K1 | + BUNDLE_RADIAL_K2)) { + LG << "Bundling k1, k2."; } else { LOG(FATAL) << "Unsupported bundle combination."; } -- cgit v1.2.3