Pixel reprojection error is ill-defined for equirectangular (e.g. EQUIRECTANGULAR) cameras: the azimuth is discontinuous at the ±π seam and its pixel scale diverges towards the poles (azimuth pixels grow as 1/cos(elevation)). Instead measure the angular error between the observed bearing and the 3D point and convert it to an equivalent pixel error at the equator, consistent with the model's pixel<
| 44 | // CamFromImgThreshold. This makes the (squared) error continuous across the |
| 45 | // seam and uniform over the sphere. |
| 46 | double SquaredSphericalReprojectionError(const double angular_error, |
| 47 | const Camera& camera) { |
| 48 | const double pixels_per_radian = |
| 49 | static_cast<double>(camera.width) / (2.0 * EIGEN_PI); |
| 50 | const double pixel_error = angular_error * pixels_per_radian; |
| 51 | return pixel_error * pixel_error; |
| 52 | } |
| 53 | |
| 54 | } // namespace |
| 55 |
no outgoing calls
no test coverage detected