pub struct DepthMap {
pub data: Array2<f32>,
pub orig_shape: (u32, u32),
}Expand description
Per-pixel depth map (in meters) for monocular depth estimation.
Fields§
§data: Array2<f32>Depth value in meters for each pixel, shape [H, W].
orig_shape: (u32, u32)Original image shape (height, width).
Implementations§
Source§impl DepthMap
impl DepthMap
Sourcepub fn min_depth(&self) -> Option<f32>
pub fn min_depth(&self) -> Option<f32>
Minimum depth in meters over valid (> 0) pixels, or None if there are none.
Sourcepub fn max_depth(&self) -> Option<f32>
pub fn max_depth(&self) -> Option<f32>
Maximum depth in meters over valid (> 0) pixels, or None if there are none.
Sourcepub fn colorize(&self, colormap: Colormap, viz: DepthViz) -> Vec<[u8; 3]>
pub fn colorize(&self, colormap: Colormap, viz: DepthViz) -> Vec<[u8; 3]>
Colorize into row-major RGB (H*W entries), invalid (<= 0) pixels black.
Uses colormap and normalization viz; shared by the native and web depth renderers.
Metric normalizes the valid-pixel depth min/max (matches Python). Disparity
normalizes inverse depth (1/d) clipped to the 2–98 percentile, so near pixels read
warm and single-pixel outliers no longer wash out the range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DepthMap
impl RefUnwindSafe for DepthMap
impl Send for DepthMap
impl Sync for DepthMap
impl Unpin for DepthMap
impl UnsafeUnpin for DepthMap
impl UnwindSafe for DepthMap
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.