python123-ops/moonground/calibration does not have a README file

    CalibrationAngleComparison

    pub struct CalibrationAngleComparison {
    first : CalibrationDirectionSensitivity
    second : CalibrationDirectionSensitivity
    cross_contribution_rad2 : Double
    angle_rad : Double
    contribution_rad2 : Double
    std_rad : Double
    // private fields
    } derive(
    Debug
    )

    Signed angle from the first directed segment to the second, in (-pi, pi]. Both directions share the same latent parameter coefficients. The local angle response is second minus first, before squaring for its contribution.

    CalibrationAngleComparison::mode_responses_rad

    fn CalibrationAngleComparison::mode_responses_rad(self : CalibrationAngleComparison) -> Array[Double]

    CalibrationAreaComparison

    pub struct CalibrationAreaComparison {
    first : CalibrationAreaSensitivity
    second : CalibrationAreaSensitivity
    cross_contribution_m4 : Double
    difference_m2 : Double
    difference_contribution_m4 : Double
    difference_std_m2 : Double
    ratio : Double
    ratio_contribution : Double
    ratio_std : Double
    // private fields
    } derive(
    Debug
    )

    First absolute area minus second, and their positive first/second ratio. Contrast responses are formed before squaring, retaining shared error cancellation. Cross contributions may be negative and have units m^4.

    CalibrationAreaComparison::difference_mode_responses_m2

    fn CalibrationAreaComparison::difference_mode_responses_m2(self : CalibrationAreaComparison) -> Array[Double]

    CalibrationAreaComparison::ratio_mode_responses

    fn CalibrationAreaComparison::ratio_mode_responses(self : CalibrationAreaComparison) -> Array[Double]

    CalibrationAreaSensitivity

    pub struct CalibrationAreaSensitivity {
    signed_area_m2 : Double
    area_m2 : Double
    contribution_m4 : Double
    std_m2 : Double
    // private fields
    } derive(
    Debug
    )

    Area of an ordered strictly convex ground polygon. signed_area_m2 is positive for counterclockwise ground winding; area_m2 is always positive. Contributions contain only the original explicit shared parameter modes.

    CalibrationAreaSensitivity::mode_responses_m2

    fn CalibrationAreaSensitivity::mode_responses_m2(self : CalibrationAreaSensitivity) -> Array[Double]

    Absolute-area response per unit original shared latent coefficient.

    CalibrationAreaSensitivity::positions_m

    Defensive copy in the caller's original vertex order.

    CalibrationContribution2

    pub struct CalibrationContribution2 {
    xx : Double
    xy : Double
    yy : Double
    } derive(
    Debug
    )

    First-order contribution from explicit shared homography parameter modes. Zero and singular contributions are valid. This is separate from the strictly positive-definite measurement Covariance2 and the ground floor.

    CalibrationDirectionSensitivity

    pub struct CalibrationDirectionSensitivity {
    first_position_m :
    Point2

    second_position_m :
    Point2

    direction :
    Point2

    distance_m : Double
    angle_rad : Double
    contribution_rad2 : Double
    std_rad : Double
    // private fields
    } derive(
    Debug
    )

    Direction of an explicitly supplied static segment, from first to second. angle_rad is measured counterclockwise from ground +x, in (-pi, pi]. Contributions describe a local angular tangent in radians, including at the display branch cut; they do not define a real-line angle interval.

    CalibrationDirectionSensitivity::mode_responses_rad

    Defensive copy in the original HomographySensitivity mode order.

    CalibrationDistanceComparison

    pub struct CalibrationDistanceComparison {
    first : CalibrationDistanceSensitivity
    second : CalibrationDistanceSensitivity
    cross_contribution_m2 : Double
    difference_m : Double
    difference_contribution_m2 : Double
    difference_std_m : Double
    ratio : Double
    ratio_contribution : Double
    ratio_std : Double
    // private fields
    } derive(
    Debug
    )

    The first distance minus the second, and their positive first/second ratio. Both distances use the same latent parameter coefficients. Contrast contributions come from mode responses before squaring, retaining common error cancellation. All contributions are local first-order estimates.

    CalibrationDistanceComparison::difference_mode_responses_m

    fn CalibrationDistanceComparison::difference_mode_responses_m(self : CalibrationDistanceComparison) -> Array[Double]

    CalibrationDistanceComparison::ratio_mode_responses

    fn CalibrationDistanceComparison::ratio_mode_responses(self : CalibrationDistanceComparison) -> Array[Double]

    Dimensionless response per unit original latent mode coefficient.

    CalibrationDistanceSensitivity

    pub struct CalibrationDistanceSensitivity {
    first_position_m :
    Point2

    second_position_m :
    Point2

    direction :
    Point2

    distance_m : Double
    contribution_m2 : Double
    std_m : Double
    // private fields
    } derive(
    Debug
    )

    Euclidean distance at the fixed calibration and its first-order response to the original shared modes. contribution_m2 excludes observation noise, the ground floor and higher-order effects. Endpoints must map distinctly.

    CalibrationDistanceSensitivity::mode_responses_m

    Defensive copy in the original HomographySensitivity mode order.

    CalibrationReport

    pub struct CalibrationReport {
    // private fields
    } derive(
    Debug
    )

    Residuals use metres. Imported matrices have no control/check residuals.

    CalibrationReport::check_count

    fn CalibrationReport::check_count(self : CalibrationReport) -> Int

    CalibrationReport::check_max_error_m

    fn CalibrationReport::check_max_error_m(self : CalibrationReport) -> Double?

    CalibrationReport::check_rms_m

    fn CalibrationReport::check_rms_m(self : CalibrationReport) -> Double?

    CalibrationReport::fit_count

    fn CalibrationReport::fit_count(self : CalibrationReport) -> Int

    CalibrationReport::fit_max_error_m

    fn CalibrationReport::fit_max_error_m(self : CalibrationReport) -> Double?

    CalibrationReport::fit_rms_m

    fn CalibrationReport::fit_rms_m(self : CalibrationReport) -> Double?

    CalibrationReport::roi_scale_bound_m_per_pixel

    fn CalibrationReport::roi_scale_bound_m_per_pixel(self : CalibrationReport) -> Double

    Conservative upper bound on the largest mapping-Jacobian singular value throughout the convex ROI. This is not a homography condition number.

    CalibrationSensitivityPair

    pub struct CalibrationSensitivityPair {
    first : CalibrationSensitivityPoint
    second : CalibrationSensitivityPoint
    displacement_m :
    Point2

    displacement_contribution_m2 : CalibrationContribution2
    // private fields
    } derive(
    Debug
    )

    Cross block is Cov(first, second), row-major [xx, xy, yx, yy]. It need not be symmetric. Displacement is second minus first. The two points share the same latent mode coefficients; their errors are correlated.

    CalibrationSensitivityPair::cross_contribution_m2

    fn CalibrationSensitivityPair::cross_contribution_m2(self : CalibrationSensitivityPair) -> Array[Double]

    CalibrationSensitivityPoint

    pub struct CalibrationSensitivityPoint {
    position_m :
    Point2

    contribution_m2 : CalibrationContribution2
    // private fields
    } derive(
    Debug
    )

    A point and its response to each original, ordered parameter mode.

    CalibrationSensitivityPoint::mode_responses_m

    Defensive copy, in the same order as HomographySensitivity::modes().

    ConvexRoi

    type ConvexRoi

    GroundCalibration

    pub struct GroundCalibration {
    // private fields
    }

    Immutable pixel-to-ground calibration. Pixels must already be undistorted.

    GroundCalibration::fit

    fn GroundCalibration::fit(control_pixels : Array[
    Point2
    ], control_world : Array[
    Point2
    ], check_pixels : Array[
    Point2
    ], check_world : Array[
    Point2
    ], roi : Array[
    Point2
    ], max_fit_error_m? : Double, max_check_error_m? : Double, max_meters_per_pixel? : Double, ground_noise_floor_m? : Double) -> GroundCalibration raise
    GroundError

    Fit at least six control pairs, then validate at least two independent hold-out pairs. All pixels must be undistorted and within the same ROI. Thresholds apply to the maximum Euclidean residual in metres, not RMS. The published geometry package supplies normalized multi-point fitting; this path deliberately does not call its 0.2.2 RANSAC estimator.

    GroundCalibration::fit_robust

    fn GroundCalibration::fit_robust(control_pixels : Array[
    Point2
    ], control_world : Array[
    Point2
    ], check_pixels : Array[
    Point2
    ], check_world : Array[
    Point2
    ], roi : Array[
    Point2
    ], options? : RobustFitOptions, max_fit_error_m? : Double, max_check_error_m? : Double, max_meters_per_pixel? : Double, ground_noise_floor_m? : Double) -> RobustCalibration raise
    GroundError

    Search only the control pairs using six-point normalized geometry fits. At least six final inliers and all independent hold-out pairs must pass. Every error and mask entry is recomputed from the returned calibration; the ground noise floor does not relax any correspondence residual gate.

    GroundCalibration::from_homography

    fn GroundCalibration::from_homography(matrix : Array[Double], roi : Array[
    Point2
    ], max_meters_per_pixel? : Double, ground_noise_floor_m? : Double) -> GroundCalibration raise
    GroundError

    Import a pixel-to-metre matrix. The ROI must be a simple strictly convex polygon. Its boundary is included; mappings outside it are rejected.

    GroundCalibration::jacobian

    Analytic row-major [dX/dx, dX/dy, dY/dx, dY/dy], in metres per pixel.

    GroundCalibration::map_point

    Map one already-undistorted pixel point within the calibrated ROI.

    GroundCalibration::matrix

    fn GroundCalibration::matrix(self : GroundCalibration) -> Array[Double]

    A defensive row-major copy of the normalized 3 by 3 matrix.

    GroundCalibration::project

    Propagate pixel covariance as J Sigma J^T and add the configured isotropic ground noise floor. This does not estimate calibration-parameter error.

    GroundCalibration::reframed

    Express this calibration in destination pixels p' = D p + t. The ground reference, SI fit/check residuals and ground noise floor remain unchanged. The ROI and the metres-per-pixel validation bound use destination pixels.

    GroundCalibration::report

    GroundCalibration::roi

    A defensive copy of the pixel-space convex ROI, in caller-supplied order.

    GroundCalibration::same_projection

    fn GroundCalibration::same_projection(self : GroundCalibration, other : GroundCalibration) -> Bool

    Compare the exact stored projection, ordered ROI, scale policy and ground noise variance. Fit/check diagnostics do not change projection behavior. This is a configuration identity check, not an approximate geometric test.

    GroundPoint

    pub struct GroundPoint {
    // private fields
    } derive(
    Debug
    )

    A mapped ground point. Covariance is conditional on the supplied calibration.

    GroundPoint::position

    HomographySensitivity

    pub struct HomographySensitivity {
    // private fields
    }

    Immutable first-order model H + sum_i(mode_i * xi_i). xi_i have zero mean, unit variance and zero mutual covariance, and are shared across points. Modes use the gauge of calibration.matrix(), including h22. No mode distribution, covariance fit or finite-perturbation bound is inferred.

    HomographySensitivity::compare_areas

    Compare two positive convex polygon areas under the same latent modes. Difference is first-second; ratio is first/second. Contributions exclude observation noise, the ground floor, lens uncertainty and higher orders.

    HomographySensitivity::compare_directions

    Signed second-relative-to-first angle, retaining shared rotation cancellation and possibly negative cross contributions. The response is a local circular tangent even at pi; it is not a derivative of the discontinuous displayed real number across that cut. No noise floor or observation noise is added.

    HomographySensitivity::compare_distances

    Compare two distances under the same model. Difference is first-second; ratio is first/second. A scalar zero first-order contribution can still have a nonlinear second-order response. These are not probability bounds.

    HomographySensitivity::distance

    Distance between two explicitly supplied already-undistorted pixels in the closed ROI. Uses the existing shared parameter projection domain. A zero ground displacement is rejected because the Euclidean norm has no unique derivative there, including when no modes were supplied.

    HomographySensitivity::evaluate

    Evaluate one already-undistorted pixel in the original closed ROI. The derivative is analytic at the fixed baseline. Contributions are ordinary binary64 first-order estimates, not outward-rounded finite-error bounds.

    HomographySensitivity::evaluate_pair

    Project two pixels under the same latent coefficients. Compute relative contribution from response differences directly, rather than subtracting large marginal/cross covariance blocks. Repeated points have exactly zero displacement contribution, including rank-deficient mode sets.

    HomographySensitivity::matrix

    fn HomographySensitivity::matrix(self : HomographySensitivity) -> Array[Double]

    A defensive copy of the exact normalized baseline to which modes are bound.

    HomographySensitivity::modes

    HomographySensitivity::new

    Construct from 0..32 finite row-major nine-coefficient perturbation modes. A caller holding a factor in another gauge must first convert that factor.

    HomographySensitivity::polygon_area

    Project 3..64 ordered already-undistorted pixel vertices in the original closed ROI. Both pixel and represented ground polygons follow the existing strict convexity rule: every other normalized edge side must exceed 1e-12. Ground winding is retained; mode responses describe positive absolute area.

    HomographySensitivity::segment_direction

    Static ground-segment direction from two already-undistorted pixels in the original closed ROI. Endpoints must map distinctly, including with no modes. Shared translation and radial displacement responses have no angular term. Reuses the original pair domain and the compensated raw-direction kernel.

    RobustCalibration

    pub struct RobustCalibration {
    // private fields
    }

    Validated calibration and diagnostics in the original control-pair order. Residuals are forward ground distances conditional on the fixed camera.

    RobustCalibration::calibration

    RobustCalibration::control_errors_m

    fn RobustCalibration::control_errors_m(self : RobustCalibration) -> Array[Double]

    RobustCalibration::inlier_count

    fn RobustCalibration::inlier_count(self : RobustCalibration) -> Int

    RobustCalibration::inlier_mask

    fn RobustCalibration::inlier_mask(self : RobustCalibration) -> Array[Bool]

    RobustCalibration::refinement_steps

    fn RobustCalibration::refinement_steps(self : RobustCalibration) -> Int

    Refit-and-reclassify passes, including the pass establishing a fixed mask.

    RobustCalibration::trials_run

    fn RobustCalibration::trials_run(self : RobustCalibration) -> Int

    Draws attempted, including degenerate or repeated subsets.

    RobustCalibration::valid_hypotheses

    fn RobustCalibration::valid_hypotheses(self : RobustCalibration) -> Int

    Candidates solved, passing the complete ROI policy, with finite residuals.

    RobustFitOptions

    pub struct RobustFitOptions {
    inlier_threshold_m : Double
    min_inlier_ratio : Double
    max_trials : Int
    seed : Int
    } derive(
    Debug
    )

    Bounded, reproducible consensus search in ground metres. Trial counts are computational budgets, rather than statistical confidence guarantees.

    RobustFitOptions::new

    fn RobustFitOptions::new(inlier_threshold_m? : Double, min_inlier_ratio? : Double, max_trials? : Int, seed? : Int) -> RobustFitOptions raise
    GroundError