Skip to content

Commit

Permalink
fix(ceres_intrinsic_camera_calibrator): use ceres min and max
Browse files Browse the repository at this point in the history
Signed-off-by: Amadeusz Szymko <[email protected]>
  • Loading branch information
amadeuszsz committed Feb 13, 2025
1 parent 48111de commit cd41b4c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ struct FOVResidual
T height_t = T(height_);

if (u >= T(0.0) && u <= width_t - T(1.0) && v >= T(0.0) && v <= height_t - T(1.0)) {
T closest_u = std::min(u, width_t - u - T(1.0)) / (std::max(height_t, width_t) - T(1.0));
T closest_v = std::min(v, height_t - v - T(1.0)) / (std::max(height_t, width_t) - T(1.0));
return std::min(closest_u, closest_v);
T closest_u = ceres::fmin(u, width_t - u - T(1.0)) / (ceres::fmax(height_t, width_t) - T(1.0));
T closest_v = ceres::fmin(v, height_t - v - T(1.0)) / (ceres::fmax(height_t, width_t) - T(1.0));
return ceres::fmin(closest_u, closest_v);
}
return T(0.0);
}
Expand Down

0 comments on commit cd41b4c

Please sign in to comment.