🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.objdetect
クラス CascadeClassifier
- java.lang.Object
-
- org.opencv.objdetect.CascadeClassifier
public class CascadeClassifier extends java.lang.Object物体検出のためのカスケード分類器クラス。
-
-
フィールドの要約
フィールド Modifier and Type Field Description protected longnativeObj
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description CascadeClassifier()protectedCascadeClassifier​(long addr)CascadeClassifier​(java.lang.String filename)Loads a classifier from a file.
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static CascadeClassifier__fromPtr__​(long addr)static booleanconvert​(java.lang.String oldcascade, java.lang.String newcascade)voiddetectMultiScale​(Mat image, MatOfRect objects)Detects objects of different sizes in the input image.voiddetectMultiScale​(Mat image, MatOfRect objects, double scaleFactor)Detects objects of different sizes in the input image.voiddetectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors)Detects objects of different sizes in the input image.voiddetectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags)Detects objects of different sizes in the input image.voiddetectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags, Size minSize)Detects objects of different sizes in the input image.voiddetectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize)Detects objects of different sizes in the input image.voiddetectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections)voiddetectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor)voiddetectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors)voiddetectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags)voiddetectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags, Size minSize)voiddetectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize)voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights)This function allows you to retrieve the final stage decision certainty of classification.voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor)This function allows you to retrieve the final stage decision certainty of classification.voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors)This function allows you to retrieve the final stage decision certainty of classification.voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags)This function allows you to retrieve the final stage decision certainty of classification.voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize)This function allows you to retrieve the final stage decision certainty of classification.voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize)This function allows you to retrieve the final stage decision certainty of classification.voiddetectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize, boolean outputRejectLevels)This function allows you to retrieve the final stage decision certainty of classification.booleanempty()Checks whether the classifier has been loaded.intgetFeatureType()longgetNativeObjAddr()SizegetOriginalWindowSize()booleanisOldFormatCascade()booleanload​(java.lang.String filename)Loads a classifier from a file.
-
-
-
メソッドの詳細
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static CascadeClassifier __fromPtr__​(long addr)
-
empty
public boolean empty()
Checks whether the classifier has been loaded.- 戻り値:
- 自動生成
-
load
public boolean load​(java.lang.String filename)
Loads a classifier from a file.- 引数:
filename- 分類器を読み込むファイルの名前。このファイルには、haartrainingアプリケーションで学習された旧式のHAAR分類器、またはtraincascadeアプリケーションで学習された新しいカスケード分類器を含めることができる。- 戻り値:
- 自動生成
-
detectMultiScale
public void detectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize)
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。flags- 関数cvHaarDetectObjectsと同じ意味を持つ、旧式カスケード用のパラメータ。新しいカスケードでは使用されない。minSize- 検出可能な物体の最小サイズ。これより小さい物体は無視される。maxSize- 検出可能な物体の最大サイズ。これより大きい物体は無視される。maxSize == minSizeの場合、モデルは単一スケールで評価される。
-
detectMultiScale
public void detectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags, Size minSize)
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。flags- 関数cvHaarDetectObjectsと同じ意味を持つ、旧式カスケード用のパラメータ。新しいカスケードでは使用されない。minSize- 検出可能な物体の最小サイズ。これより小さい物体は無視される。
-
detectMultiScale
public void detectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors, int flags)
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。flags- 関数cvHaarDetectObjectsと同じ意味を持つ、旧式カスケード用のパラメータ。新しいカスケードでは使用されない。
-
detectMultiScale
public void detectMultiScale​(Mat image, MatOfRect objects, double scaleFactor, int minNeighbors)
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。cvHaarDetectObjects。新しいカスケードでは使用されない。
-
detectMultiScale
public void detectMultiScale​(Mat image, MatOfRect objects, double scaleFactor)
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。保持する。cvHaarDetectObjects。新しいカスケードでは使用されない。
-
detectMultiScale
public void detectMultiScale​(Mat image, MatOfRect objects)
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。保持する。cvHaarDetectObjects。新しいカスケードでは使用されない。
-
detectMultiScale2
public void detectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize)
- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。numDetections- 対応する各物体の検出数のベクトル。物体の検出数とは、その物体を形成するために結合された、正と分類された隣接矩形の数である。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。flags- 関数cvHaarDetectObjectsと同じ意味を持つ、旧式カスケード用のパラメータ。新しいカスケードでは使用されない。minSize- 検出可能な物体の最小サイズ。これより小さい物体は無視される。maxSize- 検出可能な物体の最大サイズ。これより大きい物体は無視される。maxSize == minSizeの場合、モデルは単一スケールで評価される。
-
detectMultiScale2
public void detectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags, Size minSize)
- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。numDetections- 対応する各物体の検出数のベクトル。物体の検出数とは、その物体を形成するために結合された、正と分類された隣接矩形の数である。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。flags- 関数cvHaarDetectObjectsと同じ意味を持つ、旧式カスケード用のパラメータ。新しいカスケードでは使用されない。minSize- 検出可能な物体の最小サイズ。これより小さい物体は無視される。
-
detectMultiScale2
public void detectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors, int flags)
- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。numDetections- 対応する各物体の検出数のベクトル。物体の検出数とは、その物体を形成するために結合された、正と分類された隣接矩形の数である。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。flags- 関数cvHaarDetectObjectsと同じ意味を持つ、旧式カスケード用のパラメータ。新しいカスケードでは使用されない。
-
detectMultiScale2
public void detectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor, int minNeighbors)
- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。numDetections- 対応する各物体の検出数のベクトル。物体の検出数とは、その物体を形成するために結合された、正と分類された隣接矩形の数である。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。minNeighbors- 候補となる各矩形を保持するために必要な隣接矩形の数を指定するパラメータ。cvHaarDetectObjects。新しいカスケードでは使用されない。
-
detectMultiScale2
public void detectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections, double scaleFactor)
- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。numDetections- 対応する各物体の検出数のベクトル。物体の検出数とは、その物体を形成するために結合された、正と分類された隣接矩形の数である。scaleFactor- 各画像スケールで画像サイズをどれだけ縮小するかを指定するパラメータ。保持する。cvHaarDetectObjects。新しいカスケードでは使用されない。
-
detectMultiScale2
public void detectMultiScale2​(Mat image, MatOfRect objects, MatOfInt numDetections)
- 引数:
image- 物体を検出する画像を含むCV_8U型の行列。objects- 矩形のベクトル。各矩形は検出された物体を含む。矩形は元の画像の一部からはみ出すことがある。numDetections- 対応する各物体の検出数のベクトル。物体の検出数とは、その物体を形成するために結合された、正と分類された隣接矩形の数である。保持する。cvHaarDetectObjects。新しいカスケードでは使用されない。
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize, boolean outputRejectLevels)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成scaleFactor- 自動生成minNeighbors- 自動生成flags- 自動生成minSize- 自動生成maxSize- 自動生成outputRejectLevels- 自動生成
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize, Size maxSize)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成scaleFactor- 自動生成minNeighbors- 自動生成flags- 自動生成minSize- 自動生成maxSize- 自動生成
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags, Size minSize)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成scaleFactor- 自動生成minNeighbors- 自動生成flags- 自動生成minSize- 自動生成
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors, int flags)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成scaleFactor- 自動生成minNeighbors- 自動生成flags- 自動生成
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor, int minNeighbors)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成scaleFactor- 自動生成minNeighbors- 自動生成
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights, double scaleFactor)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成scaleFactor- 自動生成
-
detectMultiScale3
public void detectMultiScale3​(Mat image, MatOfRect objects, MatOfInt rejectLevels, MatOfDouble levelWeights)
This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to setoutputRejectLevelson true and provide therejectLevelsandlevelWeightsparameter. For each resulting detection,levelWeightswill then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below:Mat img; vector<double> weights; vector<int> levels; vector<Rect> detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;- 引数:
image- 自動生成objects- 自動生成rejectLevels- 自動生成levelWeights- 自動生成
-
isOldFormatCascade
public boolean isOldFormatCascade()
-
getOriginalWindowSize
public Size getOriginalWindowSize()
-
getFeatureType
public int getFeatureType()
-
convert
public static boolean convert​(java.lang.String oldcascade, java.lang.String newcascade)
-
-