🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.objdetect
クラス FaceDetectorYN
- java.lang.Object
-
- org.opencv.objdetect.FaceDetectorYN
public class FaceDetectorYN extends java.lang.ObjectDNNベースの顔検出器。モデルのダウンロードリンク: https://github.com/opencv/opencv_zoo/tree/master/models/face_detection_yunet
-
-
フィールドの要約
フィールド Modifier and Type Field Description protected longnativeObj
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedFaceDetectorYN​(long addr)
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static FaceDetectorYN__fromPtr__​(long addr)static FaceDetectorYNcreate​(java.lang.String model, java.lang.String config, Size input_size)Creates an instance of face detector class with given parametersstatic FaceDetectorYNcreate​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold)Creates an instance of face detector class with given parametersstatic FaceDetectorYNcreate​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold)Creates an instance of face detector class with given parametersstatic FaceDetectorYNcreate​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold, int top_k)Creates an instance of face detector class with given parametersstatic FaceDetectorYNcreate​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id)Creates an instance of face detector class with given parametersstatic FaceDetectorYNcreate​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id, int target_id)Creates an instance of face detector class with given parametersstatic FaceDetectorYNcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size)static FaceDetectorYNcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold)static FaceDetectorYNcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold)static FaceDetectorYNcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold, int top_k)static FaceDetectorYNcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id)static FaceDetectorYNcreate​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id, int target_id)intdetect​(Mat image, Mat faces)Detects faces in the input image.SizegetInputSize()longgetNativeObjAddr()floatgetNMSThreshold()floatgetScoreThreshold()intgetTopK()voidsetInputSize​(Size input_size)Set the size for the network input, which overwrites the input size of creating model.voidsetNMSThreshold​(float nms_threshold)Set the Non-maximum-suppression threshold to suppress bounding boxes that have IoU greater than the given valuevoidsetScoreThreshold​(float score_threshold)Set the score threshold to filter out bounding boxes of score less than the given valuevoidsetTopK​(int top_k)Set the number of bounding boxes preserved before NMS
-
-
-
メソッドの詳細
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static FaceDetectorYN __fromPtr__​(long addr)
-
setInputSize
public void setInputSize​(Size input_size)
Set the size for the network input, which overwrites the input size of creating model. Call this method when the size of input image does not match the input size when creating model- 引数:
input_size- 入力画像のサイズ
-
getInputSize
public Size getInputSize()
-
setScoreThreshold
public void setScoreThreshold​(float score_threshold)
Set the score threshold to filter out bounding boxes of score less than the given value- 引数:
score_threshold- バウンディングボックスをフィルタリングするためのしきい値
-
getScoreThreshold
public float getScoreThreshold()
-
setNMSThreshold
public void setNMSThreshold​(float nms_threshold)
Set the Non-maximum-suppression threshold to suppress bounding boxes that have IoU greater than the given value- 引数:
nms_threshold- NMS処理のためのしきい値
-
getNMSThreshold
public float getNMSThreshold()
-
setTopK
public void setTopK​(int top_k)
Set the number of bounding boxes preserved before NMS- 引数:
top_k- スコアに基づく上位ランクから保持するバウンディングボックスの数
-
getTopK
public int getTopK()
-
detect
public int detect​(Mat image, Mat faces)
Detects faces in the input image. Following is an example output. - 引数:
image- 検出対象の画像faces- 検出結果。形状 [num_faces, 15] の2次元 cv::Mat に格納される - 0-1: bboxの左上隅の x, y - 2-3: bboxの幅と高さ - 4-5: 右目の x, y (サンプル画像の青い点) - 6-7: 左目の x, y (サンプル画像の赤い点) - 8-9: 鼻先の x, y (サンプル画像の緑の点) - 10-11: 口の右端の x, y (サンプル画像のピンクの点) - 12-13: 口の左端の x, y (サンプル画像の黄色の点) - 14: 顔のスコア- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id, int target_id)
Creates an instance of face detector class with given parameters- 引数:
model- 要求するモデルへのパスconfig- 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。input_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値top_k- NMSの前に保持する上位K個のbboxbackend_id- バックエンドのIDtarget_id- ターゲットデバイスのID- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id)
Creates an instance of face detector class with given parameters- 引数:
model- 要求するモデルへのパスconfig- 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。input_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値top_k- NMSの前に保持する上位K個のbboxbackend_id- バックエンドのID- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold, int top_k)
Creates an instance of face detector class with given parameters- 引数:
model- 要求するモデルへのパスconfig- 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。input_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値top_k- NMSの前に保持する上位K個のbbox- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold, float nms_threshold)
Creates an instance of face detector class with given parameters- 引数:
model- 要求するモデルへのパスconfig- 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。input_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String model, java.lang.String config, Size input_size, float score_threshold)
Creates an instance of face detector class with given parameters- 引数:
model- 要求するモデルへのパスconfig- 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。input_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String model, java.lang.String config, Size input_size)
Creates an instance of face detector class with given parameters- 引数:
model- 要求するモデルへのパスconfig- 互換性のための設定ファイルへのパス。ONNXモデルでは要求されない。input_size- 入力画像のサイズ- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id, int target_id)
- 引数:
framework- 由来となるフレームワークの名前bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク設定を含むテキストファイルの内容を持つバッファinput_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値top_k- NMSの前に保持する上位K個のbboxbackend_id- バックエンドのIDtarget_id- ターゲットデバイスのID- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold, int top_k, int backend_id)
- 引数:
framework- 由来となるフレームワークの名前bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク設定を含むテキストファイルの内容を持つバッファinput_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値top_k- NMSの前に保持する上位K個のbboxbackend_id- バックエンドのID- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold, int top_k)
- 引数:
framework- 由来となるフレームワークの名前bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク設定を含むテキストファイルの内容を持つバッファinput_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値top_k- NMSの前に保持する上位K個のbbox- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold, float nms_threshold)
- 引数:
framework- 由来となるフレームワークの名前bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク設定を含むテキストファイルの内容を持つバッファinput_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値nms_threshold- 指定した値より大きいIoUのバウンディングボックスを抑制するためのしきい値- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size, float score_threshold)
- 引数:
framework- 由来となるフレームワークの名前bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク設定を含むテキストファイルの内容を持つバッファinput_size- 入力画像のサイズscore_threshold- 指定した値より小さいスコアのバウンディングボックスを除外するためのしきい値- 戻り値:
- 自動生成
-
create
public static FaceDetectorYN create​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig, Size input_size)
- 引数:
framework- 由来となるフレームワークの名前bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク設定を含むテキストファイルの内容を持つバッファinput_size- 入力画像のサイズ- 戻り値:
- 自動生成
-
-