pub struct Obs<'a> {
pub intrinsics: &'a Intrinsics,
pub template: &'a DMatrix<u8>,
pub image: &'a DMatrix<u8>,
pub coordinates: &'a Vec<(usize, usize)>,
pub _z_candidates: &'a Vec<Float>,
pub jacobians: &'a Vec<Vec6>,
pub hessians: &'a Vec<Mat6>,
}
Expand description
Precomputed data available for the optimizer iterations:
Fields§
§intrinsics: &'a Intrinsics
Intrinsic parameters of the camera.
template: &'a DMatrix<u8>
Reference (“keyframe”) image.
image: &'a DMatrix<u8>
Current image to track.
coordinates: &'a Vec<(usize, usize)>
Coordinates of the points used for the tracking.
_z_candidates: &'a Vec<Float>
Inverse depth of the points used for the tracking.
jacobians: &'a Vec<Vec6>
Jacobians precomputed for the points used for the tracking.
hessians: &'a Vec<Mat6>
Hessian matrices precomputed for the points used for the tracking.
Trait Implementations§
Source§impl<'a> State<Obs<'a>, Result<EvalData, f32>, Isometry<f32, U3, Unit<Quaternion<f32>>>, String> for LMOptimizerState
impl<'a> optimizer::State<Obs<'a>, EvalState, Iso3, String> for LMOptimizerState
.
impl<'a> State<Obs<'a>, Result<EvalData, f32>, Isometry<f32, U3, Unit<Quaternion<f32>>>, String> for LMOptimizerState
impl<'a> optimizer::State<Obs<'a>, EvalState, Iso3, String> for LMOptimizerState
.
Source§fn step(&self) -> Result<Iso3, String>
fn step(&self) -> Result<Iso3, String>
Compute the step using Levenberg-Marquardt. Apply the step in an inverse compositional approach to compute the next motion estimation. May return an error at the Cholesky decomposition of the hessian.
Source§fn eval(&self, obs: &Obs<'_>, model: Iso3) -> EvalState
fn eval(&self, obs: &Obs<'_>, model: Iso3) -> EvalState
Compute residuals and energy of the new model. Then, evaluate the new hessian and gradient if the energy has decreased.
Source§fn stop_criterion(
self,
nb_iter: usize,
eval_state: EvalState,
) -> (Self, Continue)
fn stop_criterion( self, nb_iter: usize, eval_state: EvalState, ) -> (Self, Continue)
Stop after too many iterations, or if the energy variation is too low.
Also update the Levenberg-Marquardt coefficient depending on if the energy increased or decreased.
Source§fn iterative_solve(
obs: &Observations,
initial_model: Model,
) -> Result<(Self, usize), Error>
fn iterative_solve( obs: &Observations, initial_model: Model, ) -> Result<(Self, usize), Error>
Auto Trait Implementations§
impl<'a> Freeze for Obs<'a>
impl<'a> RefUnwindSafe for Obs<'a>
impl<'a> Send for Obs<'a>
impl<'a> Sync for Obs<'a>
impl<'a> Unpin for Obs<'a>
impl<'a> UnwindSafe for Obs<'a>
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<T> SetParameter for T
impl<T> SetParameter 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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.