Class FaceRecognizerSF

java.lang.Object
org.opencv.objdetect.FaceRecognizerSF

public class FaceRecognizerSF
extends Object
DNN-based face recognizer model download link: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface
  • Field Details

  • Constructor Details

  • Method Details

    • getNativeObjAddr

      public long getNativeObjAddr()
    • __fromPtr__

      public static FaceRecognizerSF __fromPtr__​(long addr)
    • alignCrop

      public void alignCrop​(Mat src_img, Mat face_box, Mat aligned_img)
      Aligning image to put face on the standard position
      Parameters:
      src_img - input image
      face_box - the detection result used for indicate face in input image
      aligned_img - output aligned image
    • feature

      public void feature​(Mat aligned_img, Mat face_feature)
      Extracting face feature from aligned image
      Parameters:
      aligned_img - input aligned image
      face_feature - output face feature
    • match

      public double match​(Mat face_feature1, Mat face_feature2, int dis_type)
      Calculating 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 - defining the similarity with optional values "FR_OSINE" or "FR_NORM_L2"
      Returns:
      automatically generated
    • match

      public double match​(Mat face_feature1, Mat face_feature2)
      Calculating 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
      Returns:
      automatically generated
    • create

      public static FaceRecognizerSF create​(String model, String config, int backend_id, int target_id)
      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
      Returns:
      automatically generated
    • create

      public static FaceRecognizerSF create​(String model, String config, int backend_id)
      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
      Returns:
      automatically generated
    • create

      public static FaceRecognizerSF create​(String model, String config)
      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
      Returns:
      automatically generated
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable