pub struct KltTracker {
pub config: KltConfig,
}Expand description
Pyramidal KLT tracker.
Fields§
§config: KltConfigTracker configuration.
Implementations§
Source§impl KltTracker
impl KltTracker
Sourcepub fn track_features(
&self,
prev_frame: &[u8],
curr_frame: &[u8],
width: u32,
height: u32,
points: &[(f32, f32)],
) -> AlignResult<Vec<Option<(f32, f32)>>>
pub fn track_features( &self, prev_frame: &[u8], curr_frame: &[u8], width: u32, height: u32, points: &[(f32, f32)], ) -> AlignResult<Vec<Option<(f32, f32)>>>
Track sparse feature points from prev_frame to curr_frame using
pyramidal Lucas-Kanade optical flow.
This is the primary high-level API for KLT tracking. It accepts f32
pixel coordinates (common in feature-detection pipelines) and returns
Some((x, y)) for successfully tracked points or None when tracking
failed (low texture, out-of-bounds, etc.).
Both frames must be single-channel (grayscale), row-major byte images
of size width * height.
§Errors
Returns an error if image dimensions are inconsistent or the frame is smaller than 8×8 pixels.
Sourcepub fn track(
&self,
prev_image: &[u8],
curr_image: &[u8],
width: usize,
height: usize,
points: &[Point2D],
) -> AlignResult<Vec<TrackResult>>
pub fn track( &self, prev_image: &[u8], curr_image: &[u8], width: usize, height: usize, points: &[Point2D], ) -> AlignResult<Vec<TrackResult>>
Track a set of points from prev_image to curr_image.
Both images must be single-channel (grayscale), row-major, with the
same width and height.
§Errors
Returns an error if the image dimensions are inconsistent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KltTracker
impl RefUnwindSafe for KltTracker
impl Send for KltTracker
impl Sync for KltTracker
impl Unpin for KltTracker
impl UnsafeUnpin for KltTracker
impl UnwindSafe for KltTracker
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.