Skip to content

Commit

Permalink
fix fov calculation, not considering distortion (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
marinagmoreira authored Nov 17, 2023
1 parent 035e0e9 commit 29b6560
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions localization/camera/src/camera_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ void CameraModel::SetTransform(const Eigen::Affine3d & cam_t_global) {

double CameraModel::GetFovX(void) const {
// This is an approximation since it doesn't take in account lens distortion
return atan(1.0 / (params_.GetFocalVector()[0] * params_.GetDistortedHalfSize()[0])) * 2;
return atan(params_.GetDistortedHalfSize()[0] / params_.GetFocalVector()[0] ) * 2;
}

double CameraModel::GetFovY(void) const {
// This is an approximation since it doesn't take in account lens distortion
return atan(1.0 / (params_.GetFocalVector()[1] * params_.GetDistortedHalfSize()[1])) * 2;
return atan(params_.GetDistortedHalfSize()[1] / params_.GetFocalVector()[1] ) * 2;
}

const camera::CameraParameters& CameraModel::GetParameters() const {
Expand Down

0 comments on commit 29b6560

Please sign in to comment.