diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-10 10:48:47 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-10 10:48:47 +0400 |
commit | 4648ec3e82869ee44da88c5551d47c4f830e00c6 (patch) | |
tree | 839e78f3c645efd38b245a72c65cece45e0104c8 /extern | |
parent | 7a547e441b2a107148a9c0abb3b8badbb728abef (diff) |
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.
Diffstat (limited to 'extern')
-rw-r--r-- | extern/libmv/libmv/simple_pipeline/bundle.cc | 34 |
1 files changed, 12 insertions, 22 deletions
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); |