🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

クラス FaceRecognizerSF


  • public class FaceRecognizerSF extends java.lang.Object
    DNNベースの顔認識器。モデルのダウンロードリンク: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface
    • フィールドの要約

      フィールド
      Modifier and Type Field Description
      static int FR_COSINE  
      static int FR_NORM_L2  
      protected long nativeObj  
    • コンストラクタの要約

      コンストラクタ
      Modifier Constructor Description
      protected FaceRecognizerSF​(long addr)  
    • メソッドの要約

      すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド
      Modifier and Type Method Description
      static FaceRecognizerSF __fromPtr__​(long addr)  
      void alignCrop​(Mat src_img, Mat face_box, Mat aligned_img)
      Aligns detected face with the source input image and crops it
      static FaceRecognizerSF create​(java.lang.String model, java.lang.String config)
      Creates an instance of this class with given parameters
      static FaceRecognizerSF create​(java.lang.String model, java.lang.String config, int backend_id)
      Creates an instance of this class with given parameters
      static FaceRecognizerSF create​(java.lang.String model, java.lang.String config, int backend_id, int target_id)
      Creates an instance of this class with given parameters
      static FaceRecognizerSF create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig)
      Creates an instance of this class from a buffer containing the model weights and configuration.
      static FaceRecognizerSF create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, int backend_id)
      Creates an instance of this class from a buffer containing the model weights and configuration.
      static FaceRecognizerSF create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, int backend_id, int target_id)
      Creates an instance of this class from a buffer containing the model weights and configuration.
      void feature​(Mat aligned_img, Mat face_feature)
      Extracts face feature from aligned image
      long getNativeObjAddr()  
      double match​(Mat face_feature1, Mat face_feature2)
      Calculates the distance between two face features
      double match​(Mat face_feature1, Mat face_feature2, int dis_type)
      Calculates the distance between two face features
      • クラス java.lang.Object から継承したメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクタの詳細

      • FaceRecognizerSF

        protected FaceRecognizerSF​(long addr)
    • メソッドの詳細

      • getNativeObjAddr

        public long getNativeObjAddr()
      • alignCrop

        public void alignCrop​(Mat src_img,
                              Mat face_box,
                              Mat aligned_img)
        Aligns detected face with the source input image and crops it
        引数:
        src_img - 入力画像
        face_box - 入力画像から検出された顔の結果
        aligned_img - 出力される位置合わせ済み画像
      • feature

        public void feature​(Mat aligned_img,
                            Mat face_feature)
        Extracts face feature from aligned image
        引数:
        aligned_img - 入力となる位置合わせ済み画像
        face_feature - 出力される顔特徴
      • match

        public double match​(Mat face_feature1,
                            Mat face_feature2,
                            int dis_type)
        Calculates the distance between two face features
        引数:
        face_feature1 - 1つ目の入力特徴
        face_feature2 - face_feature1 と同じサイズかつ同じ型の2つ目の入力特徴
        dis_type - 2つの顔特徴間の距離の計算方法を定義する。指定可能な値は "FR_COSINE" または "FR_NORM_L2"
        戻り値:
        自動生成
      • match

        public double match​(Mat face_feature1,
                            Mat face_feature2)
        Calculates the distance between two face features
        引数:
        face_feature1 - 1つ目の入力特徴
        face_feature2 - face_feature1 と同じサイズかつ同じ型の2つ目の入力特徴
        戻り値:
        自動生成
      • create

        public static FaceRecognizerSF create​(java.lang.String model,
                                              java.lang.String config,
                                              int backend_id,
                                              int target_id)
        Creates an instance of this class with given parameters
        引数:
        model - 顔認識に使用するonnxモデルのパス
        config - 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。
        backend_id - バックエンドのID
        target_id - ターゲットデバイスのID
        戻り値:
        自動生成
      • create

        public static FaceRecognizerSF create​(java.lang.String model,
                                              java.lang.String config,
                                              int backend_id)
        Creates an instance of this class with given parameters
        引数:
        model - 顔認識に使用するonnxモデルのパス
        config - 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。
        backend_id - バックエンドのID
        戻り値:
        自動生成
      • create

        public static FaceRecognizerSF create​(java.lang.String model,
                                              java.lang.String config)
        Creates an instance of this class with given parameters
        引数:
        model - 顔認識に使用するonnxモデルのパス
        config - 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。
        戻り値:
        自動生成
      • create

        public static FaceRecognizerSF create​(java.lang.String framework,
                                              MatOfByte bufferModel,
                                              MatOfByte bufferConfig,
                                              int backend_id,
                                              int target_id)
        Creates an instance of this class from a buffer containing the model weights and configuration.
        引数:
        framework - フレームワークの名前 (ONNX など)
        bufferModel - バイナリのモデル重みを含むバッファ
        bufferConfig - ネットワーク設定を含むバッファ
        backend_id - バックエンドのID
        target_id - ターゲットデバイスのID
        戻り値:
        作成された FaceRecognizerSF インスタンスへのポインタ
      • create

        public static FaceRecognizerSF create​(java.lang.String framework,
                                              MatOfByte bufferModel,
                                              MatOfByte bufferConfig,
                                              int backend_id)
        Creates an instance of this class from a buffer containing the model weights and configuration.
        引数:
        framework - フレームワークの名前 (ONNX など)
        bufferModel - バイナリのモデル重みを含むバッファ
        bufferConfig - ネットワーク設定を含むバッファ
        backend_id - バックエンドのID
        戻り値:
        作成された FaceRecognizerSF インスタンスへのポインタ
      • create

        public static FaceRecognizerSF create​(java.lang.String framework,
                                              MatOfByte bufferModel,
                                              MatOfByte bufferConfig)
        Creates an instance of this class from a buffer containing the model weights and configuration.
        引数:
        framework - フレームワークの名前 (ONNX など)
        bufferModel - バイナリのモデル重みを含むバッファ
        bufferConfig - ネットワーク設定を含むバッファ
        戻り値:
        作成された FaceRecognizerSF インスタンスへのポインタ