Struct ObjectDetection

pub struct ObjectDetection(/* private fields */);
Expand description

Object Detection functionality.

Implementations§

§

impl ObjectDetection

pub fn get_detections(&mut self) -> Vec<BoxPrediction>

Obtain the object detections from the most recently processed frame.

Note that the algorithm comes with a built-in threshold (e.g. 0.6 - this differs per model): boxes with confidences lower than that value won’t be produced at all by this function.

pub fn has_box_moved( &self, prediction: &BoxPrediction, timeout_seconds: f32, ) -> Result<bool, Error>

Check if a box has moved significantly since its initial detection.

This function should only be used for boxes from the most recent video frame. This function only accepts boxes of particular classes, depending on the exact product and platform. For boxes of other classes, it will return ErrorCode::InvalidBox.

The function returns

  • false if the box has not moved since its initial detection, or if it has not moved since timeout_seconds.
  • true if the box has moved

This function should not be called directly after restoring from a previous state.

This function should not be called with boxes obtained directly after VideoIntelligence::single_image calls.

§Errors
  • Error::InvalidBox
  • Error::InvalidHasMovedTimeout

pub fn reset_tracker(&mut self)

This function is only available if the library was built with tracking support.

This resets the internal tracker state and resets all tracker ids and face identifications if applicable. It is recommended to call this whenever two consecutive frames are too different from each other, such as when switching to a different camera input or when the camera abruptly moved.

pub fn detector_version(&self) -> u32

Returns a version number of the object detector neural network.

Trait Implementations§

§

impl Debug for ObjectDetection

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.