From 4648ec3e82869ee44da88c5551d47c4f830e00c6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 10 May 2013 06:48:47 +0000 Subject: Remove check for zero focal length in BA cost functor This check is actually redundant, because empty intrinsics will have focal length of 1.0, which means original comment about BundleIntrinsics was not truth. It is possible that external user will send focal length of zero to be refined, but blender prevents this from happening. --- extern/libmv/libmv/simple_pipeline/bundle.cc | 34 ++++++++++------------------ 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'extern') diff --git a/extern/libmv/libmv/simple_pipeline/bundle.cc b/extern/libmv/libmv/simple_pipeline/bundle.cc index 17996f70def..77181654466 100644 --- a/extern/libmv/libmv/simple_pipeline/bundle.cc +++ b/extern/libmv/libmv/simple_pipeline/bundle.cc @@ -93,28 +93,18 @@ struct OpenCVReprojectionError { T predicted_x, predicted_y; - // EuclideanBundle uses empty intrinsics, which breaks undistortion code; - // so use an implied focal length of 1.0 if the focal length is exactly - // zero. - // TODO(keir): Figure out a better way to do this. - if (focal_length != T(0)) { - // Apply distortion to the normalized points to get (xd, yd). - // TODO(keir): Do early bailouts for zero distortion; these are expensive - // jet operations. - - ApplyRadialDistortionCameraIntrinsics(focal_length, - focal_length, - principal_point_x, - principal_point_y, - k1, k2, k3, - p1, p2, - xn, yn, - &predicted_x, - &predicted_y); - } else { - predicted_x = xn; - predicted_y = yn; - } + // Apply distortion to the normalized points to get (xd, yd). + // TODO(keir): Do early bailouts for zero distortion; these are expensive + // jet operations. + ApplyRadialDistortionCameraIntrinsics(focal_length, + focal_length, + principal_point_x, + principal_point_y, + k1, k2, k3, + p1, p2, + xn, yn, + &predicted_x, + &predicted_y); // The error is the difference between the predicted and observed position. residuals[0] = predicted_x - T(observed_x); -- cgit v1.2.3