Skip to content

Commit

Permalink
Fix inconsistency in spherical Intrinsic_Spherical projection functor (
Browse files Browse the repository at this point in the history
…openMVG#2087)

There is an inconsistency between the way spherical projection is computed in the ceres cost functor and the way it's defined in Camera_Spherical.hpp.
In the ceres functor the coordinates are shifted by -0.5 (top left is (0,0)) and in the Camera_Spherical.hpp file they are not (top left is (-0.5,-0.5)).
  • Loading branch information
rjanvier authored Aug 20, 2022
1 parent dbee944 commit 97fd1e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/openMVG/sfm/sfm_data_BA_ceres_camera_functor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ struct ResidualErrorFunctor_Intrinsic_Spherical
const T coord[] = {lon / (2 * M_PI), - lat / (2 * M_PI)}; // normalization

const T size ( std::max(m_imageSize[0], m_imageSize[1]) );
const T projected_x = coord[0] * size - 0.5 + m_imageSize[0] / 2.0;
const T projected_y = coord[1] * size - 0.5 + m_imageSize[1] / 2.0;
const T projected_x = coord[0] * size + m_imageSize[0] / 2.0;
const T projected_y = coord[1] * size + m_imageSize[1] / 2.0;

out_residuals[0] = projected_x - m_pos_2dpoint[0];
out_residuals[1] = projected_y - m_pos_2dpoint[1];
Expand Down

0 comments on commit 97fd1e2

Please sign in to comment.