Trait Model

Source
pub trait Model<Data> {
    // Required method
    fn residual(&self, data: &Data) -> f64;
}
Expand description

A model is a best-fit of at least some of the underlying data. You can compute residuals in respect to the model.

Required Methods§

Source

fn residual(&self, data: &Data) -> f64

Note that the residual error is returned as a 64-bit float. This allows the residual to be used for things other than sample consensus, such as optimization problems. For sample consensus, the residual should only be used to ensure it is within a threshold that roughly distinguishes inliers from outliers.

The returned residual should always be positive, with a lower residual being associated with higher probability of being an inlier rather than an outlier.

Implementors§