Struct FaceRecognizerSF

Source
pub struct FaceRecognizerSF { /* private fields */ }
Expand description

Implementations§

Source§

impl FaceRecognizerSF

Source

pub fn create( model: &str, config: &str, backend_id: i32, target_id: i32, ) -> Result<Ptr<FaceRecognizerSF>>

Creates an instance of this class with given parameters

§Parameters
  • model: the path of the onnx model used for face recognition
  • config: the path to the config file for compability, which is not requested for ONNX models
  • backend_id: the id of backend
  • target_id: the id of target device
§C++ default parameters
  • backend_id: 0
  • target_id: 0
Source

pub fn create_def(model: &str, config: &str) -> Result<Ptr<FaceRecognizerSF>>

Creates an instance of this class with given parameters

§Parameters
  • model: the path of the onnx model used for face recognition
  • config: the path to the config file for compability, which is not requested for ONNX models
  • backend_id: the id of backend
  • target_id: the id of target device
§Note

This alternative version of FaceRecognizerSF::create function uses the following default values for its arguments:

  • backend_id: 0
  • target_id: 0
Source

pub fn create_1( framework: &str, buffer_model: &Vector<u8>, buffer_config: &Vector<u8>, backend_id: i32, target_id: i32, ) -> Result<Ptr<FaceRecognizerSF>>

Creates an instance of this class from a buffer containing the model weights and configuration.

§Parameters
  • framework: Name of the framework (ONNX, etc.)
  • bufferModel: A buffer containing the binary model weights.
  • bufferConfig: A buffer containing the network configuration.
  • backend_id: The id of the backend.
  • target_id: The id of the target device.
§Returns

A pointer to the created instance of FaceRecognizerSF.

§C++ default parameters
  • backend_id: 0
  • target_id: 0
Source

pub fn create_def_1( framework: &str, buffer_model: &Vector<u8>, buffer_config: &Vector<u8>, ) -> Result<Ptr<FaceRecognizerSF>>

Creates an instance of this class from a buffer containing the model weights and configuration.

§Parameters
  • framework: Name of the framework (ONNX, etc.)
  • bufferModel: A buffer containing the binary model weights.
  • bufferConfig: A buffer containing the network configuration.
  • backend_id: The id of the backend.
  • target_id: The id of the target device.
§Returns

A pointer to the created instance of FaceRecognizerSF.

§Note

This alternative version of FaceRecognizerSF::create function uses the following default values for its arguments:

  • backend_id: 0
  • target_id: 0

Trait Implementations§

Source§

impl Boxed for FaceRecognizerSF

Source§

unsafe fn from_raw( ptr: <FaceRecognizerSF as OpenCVFromExtern>::ExternReceive, ) -> Self

Wrap the specified raw pointer Read more
Source§

fn into_raw( self, ) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
Source§

fn as_raw(&self) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
Source§

fn as_raw_mut( &mut self, ) -> <FaceRecognizerSF as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
Source§

impl Debug for FaceRecognizerSF

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for FaceRecognizerSF

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl FaceRecognizerSFTrait for FaceRecognizerSF

Source§

fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void

Source§

fn feature( &mut self, aligned_img: &impl ToInputArray, face_feature: &mut impl ToOutputArray, ) -> Result<()>

Extracts face feature from aligned image Read more
Source§

impl FaceRecognizerSFTraitConst for FaceRecognizerSF

Source§

fn as_raw_FaceRecognizerSF(&self) -> *const c_void

Source§

fn align_crop( &self, src_img: &impl ToInputArray, face_box: &impl ToInputArray, aligned_img: &mut impl ToOutputArray, ) -> Result<()>

Aligns detected face with the source input image and crops it Read more
Source§

fn match_( &self, face_feature1: &impl ToInputArray, face_feature2: &impl ToInputArray, dis_type: i32, ) -> Result<f64>

Calculates the distance between two face features Read more
Source§

fn match__def( &self, face_feature1: &impl ToInputArray, face_feature2: &impl ToInputArray, ) -> Result<f64>

Calculates the distance between two face features Read more
Source§

impl Send for FaceRecognizerSF

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<Mat> ModifyInplace for Mat
where Mat: Boxed,

Source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data, but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
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.