pub struct StereoBlockMatcher { /* private fields */ }Expand description
Stereo block matcher using Sum of Absolute Differences (SAD).
Implementations§
Source§impl StereoBlockMatcher
impl StereoBlockMatcher
Sourcepub fn new(block_size: i32, num_disparities: i32) -> Result<Self>
pub fn new(block_size: i32, num_disparities: i32) -> Result<Self>
Creates a new StereoBlockMatcher.
block_size- Side length of the square matching block (must be odd, >= 3).num_disparities- Number of disparities to search (must be > 0, divisible by 16).
Sourcepub fn with_min_disparity(self, min_disparity: i32) -> Self
pub fn with_min_disparity(self, min_disparity: i32) -> Self
Sets the minimum disparity value (default 0).
Sourcepub fn compute<B: Backend>(
&self,
left: &Image<B>,
right: &Image<B>,
) -> Result<Tensor<B, 2>>
pub fn compute<B: Backend>( &self, left: &Image<B>, right: &Image<B>, ) -> Result<Tensor<B, 2>>
Computes a disparity map from a stereo pair of grayscale images.
Both images must be single-channel (grayscale) Images of identical dimensions.
Returns a 2D tensor of shape [H, W] containing disparity values scaled by 16
(fixed-point Q4 format, matching OpenCV convention).
Auto Trait Implementations§
impl Freeze for StereoBlockMatcher
impl RefUnwindSafe for StereoBlockMatcher
impl Send for StereoBlockMatcher
impl Sync for StereoBlockMatcher
impl Unpin for StereoBlockMatcher
impl UnsafeUnpin for StereoBlockMatcher
impl UnwindSafe for StereoBlockMatcher
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