[]Trait cv::sample_consensus::Model

pub trait Model<Data> {
    fn residual(&self, data: &Data) -> f32;
}

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

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

Note that the residual error is returned as a 32-bit float. This might be harder to preserve precision with than a 64-bit float, but it will be faster to perform RANSAC if care is taken to avoid round-off error using Kahan's algorithm or using Pairwise summation. If the number of datapoints is small, then there should be little issue with the accumulation of round-off error and 32-bit floats should work without any concern.

Here are some helpers to allow you to perform less lossy summation:

If all you wish to do is filter data points out if they are above a certian threshold of error then the 32-bit float's precision will be no issue for you. Most fast RANSAC algorithms utilize this approach and score models based only on their inlier count.

Loading content...

Implementors

impl<P> Model<FeatureMatch<P>> for EssentialMatrix where
    P: Bearing
[src]

impl<P> Model<FeatureWorldMatch<P>> for WorldPose where
    P: Bearing
[src]

Loading content...