FaceRecognizerSFTraitConst

Trait FaceRecognizerSFTraitConst 

Source
pub trait FaceRecognizerSFTraitConst {
    // Required method
    fn as_raw_FaceRecognizerSF(&self) -> *const c_void;

    // Provided methods
    fn align_crop(
        &self,
        src_img: &impl ToInputArray,
        face_box: &impl ToInputArray,
        aligned_img: &mut impl ToOutputArray,
    ) -> Result<()> { ... }
    fn match_(
        &self,
        face_feature1: &impl ToInputArray,
        face_feature2: &impl ToInputArray,
        dis_type: i32,
    ) -> Result<f64> { ... }
    fn match__def(
        &self,
        face_feature1: &impl ToInputArray,
        face_feature2: &impl ToInputArray,
    ) -> Result<f64> { ... }
}
Expand description

Required Methods§

Provided Methods§

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

§Parameters
  • src_img: input image
  • face_box: the detected face result from the input image
  • aligned_img: output aligned image
Source

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

Calculates the distance between two face features

§Parameters
  • face_feature1: the first input feature
  • face_feature2: the second input feature of the same size and the same type as face_feature1
  • dis_type: defines how to calculate the distance between two face features with optional values “FR_COSINE” or “FR_NORM_L2”
§C++ default parameters
  • dis_type: FaceRecognizerSF::FR_COSINE
Source

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

Calculates the distance between two face features

§Parameters
  • face_feature1: the first input feature
  • face_feature2: the second input feature of the same size and the same type as face_feature1
  • dis_type: defines how to calculate the distance between two face features with optional values “FR_COSINE” or “FR_NORM_L2”
§Note

This alternative version of FaceRecognizerSFTraitConst::match_ function uses the following default values for its arguments:

  • dis_type: FaceRecognizerSF::FR_COSINE

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§