Skip to main content

FloatImageView

Struct FloatImageView 

Source
pub struct FloatImageView<'a> { /* private fields */ }
Expand description

A borrowed, validated, row-major f32 image, e.g. a thermal frame in °C.

The f32 detector and tracker work in the image’s own unit: no range normalization and no 8-bit conversion takes place. Validation guarantees that every value is finite and at most MAX_ABS_VALUE in magnitude, so no intermediate can overflow and no NaN can reach the score comparisons. Replace invalid pixels (e.g. dead sensor pixels) before creating the view.

Implementations§

Source§

impl<'a> FloatImageView<'a>

Source

pub const MAX_ABS_VALUE: f32 = 16_777_216.0

Largest accepted pixel magnitude, 2^24. Within it, Scharr gradients, structure-tensor sums and their determinant stay finite.

Source

pub fn new( pixels: &'a [f32], width: u32, height: u32, ) -> Result<Self, FloatImageError>

Validates pixels as a width x height row-major image.

Costs one pass over the pixels.

Source

pub fn width(&self) -> u32

Width in pixels.

Source

pub fn height(&self) -> u32

Height in pixels.

Source

pub fn dimensions(&self) -> (u32, u32)

(width, height) in pixels.

Source

pub fn pixels(&self) -> &'a [f32]

The validated pixels, row by row.

Trait Implementations§

Source§

impl<'a> Clone for FloatImageView<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for FloatImageView<'a>

Source§

impl<'a> Debug for FloatImageView<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for FloatImageView<'a>

§

impl<'a> RefUnwindSafe for FloatImageView<'a>

§

impl<'a> Send for FloatImageView<'a>

§

impl<'a> Sync for FloatImageView<'a>

§

impl<'a> Unpin for FloatImageView<'a>

§

impl<'a> UnsafeUnpin for FloatImageView<'a>

§

impl<'a> UnwindSafe for FloatImageView<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.