Skip to main content

Crate optical_flow_lk

Crate optical_flow_lk 

Source
Expand description

High-performance computer vision algorithms for real-time applications

Provides implementations of:

  • Lucas-Kanade optical flow
  • Shi-Tomasi feature detection
  • Optimized image processing pipelines

Designed to be compatible with WebAssembly (Wasm).

Structs§

Corner
A detected corner: its pixel position and its Shi-Tomasi score, the minimum eigenvalue of the mean 3x3 structure tensor.
DetectorCapacity
Upper bounds for the work a detector context will see, used to allocate every buffer up front with DetectorContext::with_capacity or DetectorContext::reserve.
DetectorContext
Reusable owner of every buffer the Shi-Tomasi detector touches: gradient planes, structure-tensor row buffers, the score plane, the candidate list, the spacing grid and the result vector.
FloatDetectorContext
Shi-Tomasi corner detector for f32 images in physical units, e.g. thermal frames in °C. The counterpart of DetectorContext, owning every buffer it touches.
FloatImageView
A borrowed, validated, row-major f32 image, e.g. a thermal frame in °C.
FloatTrackerContext
Pyramidal Lucas-Kanade tracker for f32 images in physical units, e.g. thermal frames in °C. The counterpart of TrackerContext, owning both frame pyramids and every buffer the tracking hot path touches.
Grid
Detection grid of good_features_to_track_grid and detect_grid: the image is split into cols x rows equal cells, and each cell keeps up to max_per_cell corners, counting existing points.
ScoreThreshold
Corner score threshold of the f32 detector.
TrackOptions
Options of a tracking call beyond TrackParams, for TrackerContext::track_with and TrackerContext::track_fb_with and their FloatTrackerContext counterparts. The default reproduces track and track_fb.
TrackParams
Lucas-Kanade parameters of a tracking call.
TrackResult
Per-point result of calc_optical_flow_ex.
TrackerCapacity
Upper bounds for the work a tracker context will see, used to allocate every buffer up front with with_capacity or reserve of TrackerContext and FloatTrackerContext.
TrackerContext
Reusable owner of every buffer the tracking hot path touches: both frame pyramids, the Lucas-Kanade scratch, the result vector and the forward-backward intermediates.

Enums§

FloatImageError
Why FloatImageView::new rejected an image.
TrackKernel
Arithmetic of the 8-bit tracker’s window kernels, see TrackOptions::kernel.
TrackStatus
Why a feature point ended up where it did after tracking.

Constants§

CONVERGENCE_EPSILON
Per-level convergence threshold, in pixels of the current pyramid level.
DEFAULT_FB_THRESHOLD
Default forward-backward round-trip threshold (pixels) for calc_optical_flow_fb.
DEFAULT_MIN_EIGEN_THRESHOLD
Default TrackParams::min_eigen_threshold of the 8-bit tracker.

Functions§

build_pyramid
Builds a pyramid of images where each successive layer is half as large in width and height
build_pyramid_into
Builds the pyramid into an existing buffer, reusing each level’s storage when its dimensions are unchanged.
calc_optical_flow_ex
Compute optical flow using the pyramidal Lucas-Kanade method, returning a per-point TrackResult with status and photometric error.
calc_optical_flow_fb
Track points prev->next, then re-track the results next->prev, and flag any point whose round-trip lands further than fb_threshold pixels from where it started as TrackStatus::FbInconsistent.
good_features_to_track
Finds good features points using the Shi-Tomasi algorithm
good_features_to_track_grid
Finds good feature points with uniform frame coverage by detecting per grid cell, while respecting features that are already being tracked.

Type Aliases§

FloatPyramidLevel
One level of an f32 image pyramid, as built by FloatTrackerContext.