solvers.StereoDepthErrorModel
solvers.StereoDepthErrorModel()One-sigma stereo depth error against range, and where it spends each clearance.
sigma_z = z^2 sigma_d / (f b) grows with squared range; the range at which one sigma equals a clearance C is sqrt(C f b / sigma_d). Adding one sigma to a clearance kept along the viewing ray is the shortcut inset; an unmodeled baseline change db biases depth by z db / b.
Methods
| Name | Description |
|---|---|
| solve | Propagate stereo disparity uncertainty into range-dependent depth error. |
solve
solvers.StereoDepthErrorModel.solve(
baseline,
focal_length_px,
disparity_sigma_px,
near_range,
far_range,
target_range,
ray_clearance,
loc_allowance,
side_clearance,
baseline_change,
bias_range,
)Propagate stereo disparity uncertainty into range-dependent depth error.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| baseline | Quantity | Positive camera separation, in length units. | required |
| focal_length_px | float | Positive rectified-camera focal length, in pixels. | required |
| disparity_sigma_px | float | Positive disparity standard deviation, in pixels. | required |
| near_range | Quantity | Positive near comparison depth, in length units. | required |
| far_range | Quantity | Positive far comparison depth, in length units. | required |
| target_range | Quantity | Positive depth of the target whose uncertainty is reported. | required |
| ray_clearance | Quantity | Nonnegative clearance added to one standard deviation along the ray. | required |
| loc_allowance | Quantity | Positive localization allowance used to invert the uncertainty equation. | required |
| side_clearance | Quantity | Positive second error allowance used for range comparisons. | required |
| baseline_change | Quantity | Nonnegative magnitude of unmodeled baseline change. | required |
| bias_range | Quantity | Positive depth at which baseline-change bias is evaluated. | required |
Returns
| Name | Type | Description |
|---|---|---|
| StereoDepthErrorResult | One-sigma errors, clearance-plus-sigma insets, and baseline bias in millimeters; inverse-error ranges in meters; dimensionless growth ratios. One sigma is not a guaranteed containment interval. |
See Also
mlsysim.physics.robotics.sensing.calc_stereo_depth_sigma : Disparity propagation. mlsysim.physics.robotics.sensing.calc_stereo_range_for_sigma : Inverse error relation. mlsysim.physics.robotics.sensing.calc_stereo_baseline_bias : Baseline sensitivity.
Notes
Equation: sigma_z = z**2*sigma_d/(f*b); z_at_allowance = sqrt(allowance*f*b/sigma_d); baseline bias = bias_range*baseline_change/b. The near and far insets add ray_clearance to their respective sigma_z.
Assumptions: Rectified pinhole stereo, small disparity errors, fixed f and b, and the same disparity variance across all evaluated depths.
Excludes: Occlusions, matching outliers, lens/calibration covariance, correlated errors, and any claimed collision-risk probability.
References
Derivation: Differentiate z=f*b/disparity with respect to disparity to propagate one standard deviation; invert that expression for a chosen error allowance. Baseline enters linearly at fixed disparity.
Examples
>>> from mlsysim.core.units import Q_
>>> r = StereoDepthErrorModel().solve(Q_("0.1 m"), 1000, 1, Q_("1 m"), Q_("2 m"), Q_("1 m"), Q_("1 mm"), Q_("10 mm"), Q_("20 mm"), Q_("0 mm"), Q_("1 m"))
>>> r.sigma_far == 4 * r.sigma_near and r.baseline_bias == Q_("0 mm")
True