Skip to content

Commit

Permalink
opencv-calibrate: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Jul 23, 2024
1 parent eb14b44 commit 550d751
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions opencv-calibrate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ impl From<ffi::cv_return_value_slice> for Result<SliceData, Error> {

#[derive(Debug)]
pub struct CalibrationResult {
/// mean reprojection error
pub mean_reprojection_error: f64,
/// mean reprojection distance, in pixels
pub mean_reprojection_distance_pixels: f64,
/// camera calibration matrix, row major order
pub camera_matrix: [f64; 9],
/// non-linear distortion coefficients (k1, k2, p1, p2, k3)
Expand Down Expand Up @@ -132,12 +132,12 @@ pub fn calibrate_camera(
)
}
.into();
let mean_reprojection_error = r1?;
let mean_reprojection_distance_pixels = r1?;

debug_assert!(rotation_matrices.len() == all_pts.len());
debug_assert!(translation_vectors.len() == all_pts.len());
Ok(CalibrationResult {
mean_reprojection_error,
mean_reprojection_distance_pixels,
camera_matrix,
distortion_coeffs,
rotation_matrices,
Expand Down
4 changes: 2 additions & 2 deletions strand-cam/strand-cam-offline-checkerboards/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn main() -> Result<()> {

info!(
"Mean reprojection error: {}",
raw_opencv_cal.mean_reprojection_error
raw_opencv_cal.mean_reprojection_distance_pixels
);
info!("got calibrated intrinsics: {:?}", intrinsics);

Expand Down Expand Up @@ -141,7 +141,7 @@ fn main() -> Result<()> {
# Mean reprojection distance: {:.2}\n",
env!["CARGO_PKG_NAME"],
local,
raw_opencv_cal.mean_reprojection_error
raw_opencv_cal.mean_reprojection_distance_pixels
)
.as_bytes(),
)?;
Expand Down

0 comments on commit 550d751

Please sign in to comment.