Type Alias DisparityFrame

Source
pub type DisparityFrame = ImageFrame<Disparity>;
Expand description

An ImageFrame type holding the raw pointer and derived metadata for an RS2 Disparity frame.

All fields in this struct are initialized during struct creation (via try_from). Everything called from here during runtime should be valid as long as the Frame is in scope… like normal Rust.

Aliased Type§

pub struct DisparityFrame { /* private fields */ }

Implementations§

Source§

impl DisparityFrame

Source

pub fn distance(&self, col: usize, row: usize) -> Result<f32, DepthError>

Given the 2D depth coordinate (x,y) provide the corresponding depth in metric units.

§Warning

Like with depth frames, this method is fairly expensive to use in practice. The disparity can be converted to depth fairly easily, but this will effectively copy every pixel if you loop through the data with this method for every index.

It is often much more efficient to directly stream the Rs2Format::Distance format if you want the distance directly, and access the frame data with ImageFrame::get.

Source

pub fn depth_units(&self) -> Result<f32>

Get the metric units currently used for reporting depth information.

Source

pub fn baseline(&self) -> Result<f32, DisparityError>

Get the baseline used during construction of the Disparity frame

Trait Implementations§

Source§

impl FrameCategory for DisparityFrame

Source§

fn extension() -> Rs2Extension

Identifies the corresponding Rs2Extension for the type implementing this trait.
Source§

fn kind() -> Rs2StreamKind

Identifies the stream kind corresponding to a given type implementing this trait.
Source§

fn has_correct_kind(&self) -> bool

Predicate for checking if the RS2 frame’s stream has the same kind as the frame category.