🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.objdetect
クラス FaceRecognizerSF
- java.lang.Object
-
- org.opencv.objdetect.FaceRecognizerSF
public class FaceRecognizerSF extends java.lang.ObjectDNNベースの顔認識器。モデルのダウンロードリンク: https://github.com/opencv/opencv_zoo/tree/master/models/face_recognition_sface
-
-
フィールドの要約
フィールド Modifier and Type Field Description static intFR_COSINEstatic intFR_NORM_L2protected longnativeObj
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedFaceRecognizerSF​(long addr)
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static FaceRecognizerSF__fromPtr__​(long addr)voidalignCrop​(Mat src_img, Mat face_box, Mat aligned_img)Aligns detected face with the source input image and crops itstatic FaceRecognizerSFcreate​(java.lang.String model, java.lang.String config)Creates an instance of this class with given parametersstatic FaceRecognizerSFcreate​(java.lang.String model, java.lang.String config, int backend_id)Creates an instance of this class with given parametersstatic FaceRecognizerSFcreate​(java.lang.String model, java.lang.String config, int backend_id, int target_id)Creates an instance of this class with given parametersstatic FaceRecognizerSFcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig)Creates an instance of this class from a buffer containing the model weights and configuration.static FaceRecognizerSFcreate​(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 FaceRecognizerSFcreate​(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.voidfeature​(Mat aligned_img, Mat face_feature)Extracts face feature from aligned imagelonggetNativeObjAddr()doublematch​(Mat face_feature1, Mat face_feature2)Calculates the distance between two face featuresdoublematch​(Mat face_feature1, Mat face_feature2, int dis_type)Calculates the distance between two face features
-
-
-
メソッドの詳細
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static FaceRecognizerSF __fromPtr__​(long addr)
-
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- バックエンドのIDtarget_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- バックエンドのIDtarget_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 インスタンスへのポインタ
-
-