Struct VideoIntelligence

pub struct VideoIntelligence { /* private fields */ }
Expand description

Contains all Plumerai Video Intelligence functionality.

Implementations§

§

impl VideoIntelligence

pub fn detection_zones(&self) -> DetectionZones

Returns the detection zone functionality.

§

impl VideoIntelligence

pub fn face_enrollment_automatic( &self, ) -> Result<FaceEnrollmentAutomatic, Error>

Returns the automatic face enrollment functionality.

§Errors
  • Error::NotAvailable
§

impl VideoIntelligence

pub fn face_enrollment_manual(&self) -> Result<FaceEnrollmentManual, Error>

Returns the manual face enrollment functionality.

§Errors
  • Error::NotAvailable
§

impl VideoIntelligence

pub fn face_identification(&self) -> Result<FaceIdentification, Error>

Returns the face identification functionality.

§Errors
  • Error::NotAvailable
§

impl VideoIntelligence

pub fn motion_detection(&self) -> MotionDetection

Returns the motion detection functionality.

§

impl VideoIntelligence

pub fn object_detection(&self) -> ObjectDetection

Returns the object detection functionality.

§

impl VideoIntelligence

pub fn new(input_resolution: Size) -> Self

pub fn process_frame( &mut self, image_pointer: &ImagePointer<'_>, delta_t: Option<f32>, ) -> Result<(), Error>

Process a single frame from a video sequence.

Make sure the image is right side up. When it is upside down it can still work but accuracy is significantly degraded.

If delta_t is None, the system clock will be used. Otherwise it should be positive.

§Errors
  • Error::InvalidDeltaT
  • Error::NoFaceInView
  • Error::MultipleFacesInView
  • Error::FaceCloseToEdge

pub fn single_image( &mut self, image_pointer: &ImagePointer<'_>, size: ImageSize, ) -> Result<(), Error>

Process a single image not part of a video sequence.

This should not be used for video data. It can be used for face enrollments from a set of images. The object detection box id values obtained after calling single_image are not related to those generated through process_frame or through other calls to single_image.

Optionally a different size image can be specified.

§Errors
  • Error::NoFaceInView
  • Error::MultipleFacesInView
  • Error::FaceCloseToEdge

pub fn set_night_mode(&mut self, night_mode: bool)

Configure the video intelligence algorithm for either day mode color videos (default) or night mode IR videos.

This configures the video intelligence algorithm for optimal performance on day mode color data (default) or on night mode IR data.

After switching from day to night mode or back, the motion detection algorithm will need a couple of video frames to stabilize, so the motion-grid will not be immediately available.

This function does not have to be called before every frame, only when switching from RGB to IR video data or back.

pub fn store_state(&self) -> Result<State, Error>

Store the current state of the algorithm.

This function can be used when processing a video in chunks, doing different chunks at different times or on different machines. The state can be restored by calling restore_state with the data returned by store_state. When the library is built with support for familiar face identification, the state includes the face library.

Constraints:

  • The delta_t parameter of process_frame can not be None after restoring a previous state.
  • If familiar face identification is enabled, the state can only be stored and restored when not enrolling.
§Errors
  • Error::StateWhileEnrolling

pub fn restore_state(&mut self, state: State) -> Result<(), Error>

Restore the state of the algorithm.

See store_state for more information. The user must ensure that the height and width of the current object match the height and width of the state that is being restored.

§Errors
  • Error::StateWhileEnrolling
  • Error::StateSettingsMismatch
  • Error::StateCorrupt

pub fn debug_mode_start( &mut self, image_options: DebugImageOptions, ) -> Result<(), Error>

Enable debug mode.

When process_frame is called while debug mode is active, this will store debug information. This data is meant to be stored to a file to be shared with Plumerai support for further analysis. These files contain uncompressed input image data and can become large (several megabytes per frame). If image_options is set to Exclude, no image data will be included.

The resulting debug data can be retrieved using debug_mode_end.

§Errors
  • Error::NotAvailable

pub fn debug_mode_end(&mut self) -> Result<DebugBytes, Error>

Stop debug mode and retrieve the debug data.

§Errors
  • Error::NotAvailable

pub fn code_version() -> String

Returns the version of the video intelligence code as a date and time.

For other version numbers, see also ObjectDetection::detector_version for the object detector, and FaceIdentification::embedding_version for the face embedder.

@return The version of the code as YYYY.MM.DD.HH.MM date and time string.

Trait Implementations§

§

impl Debug for VideoIntelligence

§

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.