pub struct WeightedHomographyRefiner {
pub sigma: f64,
pub iterations: usize,
}Expand description
Weighted least squares homography refiner.
After RANSAC identifies inliers, this refiner computes a more accurate homography by weighting each correspondence inversely by its reprojection error. Points closer to the model contribute more, producing estimates that are more robust to near-outlier noise.
The weighting function is a Cauchy (Lorentzian) kernel:
w(e) = 1 / (1 + (e / sigma)^2)This is iterated several times (IRLS - Iteratively Reweighted Least Squares) to converge to a robust M-estimate.
Fields§
§sigma: f64Scale parameter for the Cauchy kernel.
iterations: usizeNumber of IRLS iterations.
Implementations§
Source§impl WeightedHomographyRefiner
impl WeightedHomographyRefiner
Sourcepub fn refine(
&self,
initial: &Homography,
matches: &[MatchPair],
) -> AlignResult<Homography>
pub fn refine( &self, initial: &Homography, matches: &[MatchPair], ) -> AlignResult<Homography>
Refine a homography using iteratively reweighted least squares.
initial is the RANSAC-estimated homography.
matches is the full set of inlier correspondences.
§Errors
Returns an error if there are fewer than 4 matches or the system is degenerate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WeightedHomographyRefiner
impl RefUnwindSafe for WeightedHomographyRefiner
impl Send for WeightedHomographyRefiner
impl Sync for WeightedHomographyRefiner
impl Unpin for WeightedHomographyRefiner
impl UnsafeUnpin for WeightedHomographyRefiner
impl UnwindSafe for WeightedHomographyRefiner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.