pub struct OpticalFlow;Expand description
Optical Flow analyzer.
Implementations§
Source§impl OpticalFlow
impl OpticalFlow
Sourcepub fn calc_dense_farneback<B: Backend>(
prev: &Image<B>,
next: &Image<B>,
) -> Result<Tensor<B, 3>>
pub fn calc_dense_farneback<B: Backend>( prev: &Image<B>, next: &Image<B>, ) -> Result<Tensor<B, 3>>
Computes dense optical flow using Farneback’s algorithm. Returns flow tensor of shape [2, H, W] containing flow vectors (dx, dy).
Farneback’s method works by:
- Expanding each image into a quadratic polynomial using Gaussian weighting
- Computing the displacement field from the polynomial expansion coefficients
- Refining the flow iteratively at multiple scales
Sourcepub fn calc_sparse_pyr_lk<B: Backend>(
prev: &Image<B>,
next: &Image<B>,
prev_pts: &[Point<f64>],
) -> Result<(Vec<Point<f64>>, Vec<u8>)>
pub fn calc_sparse_pyr_lk<B: Backend>( prev: &Image<B>, next: &Image<B>, prev_pts: &[Point<f64>], ) -> Result<(Vec<Point<f64>>, Vec<u8>)>
Computes sparse optical flow using Lucas-Kanade feature tracking.
For each point in prev_pts, finds the corresponding location in the next frame
by solving the Lucas-Kanade equations in a local window.
Auto Trait Implementations§
impl Freeze for OpticalFlow
impl RefUnwindSafe for OpticalFlow
impl Send for OpticalFlow
impl Sync for OpticalFlow
impl Unpin for OpticalFlow
impl UnsafeUnpin for OpticalFlow
impl UnwindSafe for OpticalFlow
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more