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

クラス HOGDescriptor


  • public class HOGDescriptor extends java.lang.Object
    HOG (Histogram of Oriented Gradients) 記述子およびオブジェクト検出器の実装。HOG記述子アルゴリズムは Navneet Dalal と Bill Triggs によって提案された CITE: Dalal2005 。参考リンク: https://hal.inria.fr/inria-00548512/document/ https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients https://software.intel.com/en-us/ipp-dev-reference-histogram-of-oriented-gradients-hog-descriptor http://www.learnopencv.com/histogram-of-oriented-gradients http://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial
    • コンストラクタの詳細

      • HOGDescriptor

        protected HOGDescriptor​(long addr)
      • HOGDescriptor

        public HOGDescriptor()
        Creates the HOG descriptor and detector with default parameters. aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9 )
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture,
                             double _winSigma,
                             int _histogramNormType,
                             double _L2HysThreshold,
                             boolean _gammaCorrection,
                             int _nlevels,
                             boolean _signedGradient)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
        _winSigma - winSigma を指定した値に設定する。
        _histogramNormType - histogramNormType を指定した値に設定する。
        _L2HysThreshold - L2HysThreshold を指定した値に設定する。
        _gammaCorrection - gammaCorrection を指定した値に設定する。
        _nlevels - nlevels を指定した値に設定する。
        _signedGradient - signedGradient を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture,
                             double _winSigma,
                             int _histogramNormType,
                             double _L2HysThreshold,
                             boolean _gammaCorrection,
                             int _nlevels)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
        _winSigma - winSigma を指定した値に設定する。
        _histogramNormType - histogramNormType を指定した値に設定する。
        _L2HysThreshold - L2HysThreshold を指定した値に設定する。
        _gammaCorrection - gammaCorrection を指定した値に設定する。
        _nlevels - nlevels を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture,
                             double _winSigma,
                             int _histogramNormType,
                             double _L2HysThreshold,
                             boolean _gammaCorrection)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
        _winSigma - winSigma を指定した値に設定する。
        _histogramNormType - histogramNormType を指定した値に設定する。
        _L2HysThreshold - L2HysThreshold を指定した値に設定する。
        _gammaCorrection - gammaCorrection を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture,
                             double _winSigma,
                             int _histogramNormType,
                             double _L2HysThreshold)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
        _winSigma - winSigma を指定した値に設定する。
        _histogramNormType - histogramNormType を指定した値に設定する。
        _L2HysThreshold - L2HysThreshold を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture,
                             double _winSigma,
                             int _histogramNormType)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
        _winSigma - winSigma を指定した値に設定する。
        _histogramNormType - histogramNormType を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture,
                             double _winSigma)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
        _winSigma - winSigma を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins,
                             int _derivAperture)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
        _derivAperture - derivAperture を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(Size _winSize,
                             Size _blockSize,
                             Size _blockStride,
                             Size _cellSize,
                             int _nbins)
        引数:
        _winSize - winSize を指定した値に設定する。
        _blockSize - blockSize を指定した値に設定する。
        _blockStride - blockStride を指定した値に設定する。
        _cellSize - cellSize を指定した値に設定する。
        _nbins - nbins を指定した値に設定する。
      • HOGDescriptor

        public HOGDescriptor​(java.lang.String filename)
        Creates the HOG descriptor and detector and loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file.
        引数:
        filename - HOGDescriptor のプロパティと線形SVM分類器の係数を格納したファイルの名前。
    • メソッドの詳細

      • getNativeObjAddr

        public long getNativeObjAddr()
      • __fromPtr__

        public static HOGDescriptor __fromPtr__​(long addr)
      • getDescriptorSize

        public long getDescriptorSize()
        Returns the number of coefficients required for the classification.
        戻り値:
        自動生成
      • checkDetectorSize

        public boolean checkDetectorSize()
        Checks if detector size equal to descriptor size.
        戻り値:
        自動生成
      • getWinSigma

        public double getWinSigma()
        Returns winSigma value
        戻り値:
        自動生成
      • setSVMDetector

        public void setSVMDetector​(Mat svmdetector)
        Sets coefficients for the linear SVM classifier.
        引数:
        svmdetector - 線形SVM分類器の係数。
      • load

        public boolean load​(java.lang.String filename,
                            java.lang.String objname)
        loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file
        引数:
        filename - 読み込むファイルの名前。
        objname - 読み込むノードの名前(省略可能。空の場合は最初のトップレベルノードが使用される)。
        戻り値:
        自動生成
      • load

        public boolean load​(java.lang.String filename)
        loads HOGDescriptor parameters and coefficients for the linear SVM classifier from a file
        引数:
        filename - 読み込むファイルの名前。
        戻り値:
        自動生成
      • save

        public void save​(java.lang.String filename,
                         java.lang.String objname)
        saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
        引数:
        filename - ファイル名
        objname - オブジェクト名
      • save

        public void save​(java.lang.String filename)
        saves HOGDescriptor parameters and coefficients for the linear SVM classifier to a file
        引数:
        filename - ファイル名
      • compute

        public void compute​(Mat img,
                            MatOfFloat descriptors,
                            Size winStride,
                            Size padding,
                            MatOfPoint locations)
        Computes HOG descriptors of given image.
        引数:
        img - HOG特徴を計算する画像を格納した CV_8U 型の行列。
        descriptors - CV_32F 型の行列
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
        locations - Point のベクトル
      • compute

        public void compute​(Mat img,
                            MatOfFloat descriptors,
                            Size winStride,
                            Size padding)
        Computes HOG descriptors of given image.
        引数:
        img - HOG特徴を計算する画像を格納した CV_8U 型の行列。
        descriptors - CV_32F 型の行列
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
      • compute

        public void compute​(Mat img,
                            MatOfFloat descriptors,
                            Size winStride)
        Computes HOG descriptors of given image.
        引数:
        img - HOG特徴を計算する画像を格納した CV_8U 型の行列。
        descriptors - CV_32F 型の行列
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
      • compute

        public void compute​(Mat img,
                            MatOfFloat descriptors)
        Computes HOG descriptors of given image.
        引数:
        img - HOG特徴を計算する画像を格納した CV_8U 型の行列。
        descriptors - CV_32F 型の行列
      • detect

        public void detect​(Mat img,
                           MatOfPoint foundLocations,
                           MatOfDouble weights,
                           double hitThreshold,
                           Size winStride,
                           Size padding,
                           MatOfPoint searchLocations)
        Performs object detection without a multi-scale window.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各点が検出されたオブジェクト境界の左上隅の点を含む点のベクトル。
        weights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
        searchLocations - 評価を要求する位置の集合を含む Point のベクトル。
      • detect

        public void detect​(Mat img,
                           MatOfPoint foundLocations,
                           MatOfDouble weights,
                           double hitThreshold,
                           Size winStride,
                           Size padding)
        Performs object detection without a multi-scale window.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各点が検出されたオブジェクト境界の左上隅の点を含む点のベクトル。
        weights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
      • detect

        public void detect​(Mat img,
                           MatOfPoint foundLocations,
                           MatOfDouble weights,
                           double hitThreshold,
                           Size winStride)
        Performs object detection without a multi-scale window.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各点が検出されたオブジェクト境界の左上隅の点を含む点のベクトル。
        weights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
      • detect

        public void detect​(Mat img,
                           MatOfPoint foundLocations,
                           MatOfDouble weights,
                           double hitThreshold)
        Performs object detection without a multi-scale window.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各点が検出されたオブジェクト境界の左上隅の点を含む点のベクトル。
        weights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
      • detect

        public void detect​(Mat img,
                           MatOfPoint foundLocations,
                           MatOfDouble weights)
        Performs object detection without a multi-scale window.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各点が検出されたオブジェクト境界の左上隅の点を含む点のベクトル。
        weights - 検出された各オブジェクトの信頼度の値を格納するベクトル。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights,
                                     double hitThreshold,
                                     Size winStride,
                                     Size padding,
                                     double scale,
                                     double groupThreshold,
                                     boolean useMeanshiftGrouping)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
        scale - 検出ウィンドウの拡大係数。
        groupThreshold - 類似度しきい値を調整する係数。検出時、一部のオブジェクトは多数の矩形で覆われることがある。0はグループ化を行わないことを意味する。
        useMeanshiftGrouping - グループ化アルゴリズムを指定する
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights,
                                     double hitThreshold,
                                     Size winStride,
                                     Size padding,
                                     double scale,
                                     double groupThreshold)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
        scale - 検出ウィンドウの拡大係数。
        groupThreshold - 類似度しきい値を調整する係数。検出時、一部のオブジェクトは多数の矩形で覆われることがある。0はグループ化を行わないことを意味する。
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights,
                                     double hitThreshold,
                                     Size winStride,
                                     Size padding,
                                     double scale)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング
        scale - 検出ウィンドウの拡大係数。多数の矩形によって。0はグループ化を行わないことを意味する。
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights,
                                     double hitThreshold,
                                     Size winStride,
                                     Size padding)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。
        padding - パディング。多数の矩形によって。0はグループ化を行わないことを意味する。
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights,
                                     double hitThreshold,
                                     Size winStride)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。
        winStride - ウィンドウのストライド。ブロックストライドの倍数でなければならない。多数の矩形によって。0はグループ化を行わないことを意味する。
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights,
                                     double hitThreshold)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。
        hitThreshold - 特徴とSVM分類平面との距離に対するしきい値。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。多数の矩形によって。0はグループ化を行わないことを意味する。
      • detectMultiScale

        public void detectMultiScale​(Mat img,
                                     MatOfRect foundLocations,
                                     MatOfDouble foundWeights)
        Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
        引数:
        img - オブジェクトを検出する画像を格納した CV_8U または CV_8UC3 型の行列。
        foundLocations - 各矩形が検出されたオブジェクトを含む矩形のベクトル。
        foundWeights - 検出された各オブジェクトの信頼度の値を格納するベクトル。通常は0であり、検出器の係数(最後の自由係数)として指定すべきである。ただし自由係数が省略されている場合(省略は許可される)は、ここで手動で指定できる。多数の矩形によって。0はグループ化を行わないことを意味する。
      • computeGradient

        public void computeGradient​(Mat img,
                                    Mat grad,
                                    Mat angleOfs,
                                    Size paddingTL,
                                    Size paddingBR)
        Computes gradients and quantized gradient orientations.
        引数:
        img - 計算対象の画像を格納した行列
        grad - 計算された勾配を格納する CV_32FC2 型の行列
        angleOfs - 量子化された勾配方向を格納する CV_8UC2 型の行列
        paddingTL - 左上からのパディング
        paddingBR - 右下からのパディング
      • computeGradient

        public void computeGradient​(Mat img,
                                    Mat grad,
                                    Mat angleOfs,
                                    Size paddingTL)
        Computes gradients and quantized gradient orientations.
        引数:
        img - 計算対象の画像を格納した行列
        grad - 計算された勾配を格納する CV_32FC2 型の行列
        angleOfs - 量子化された勾配方向を格納する CV_8UC2 型の行列
        paddingTL - 左上からのパディング
      • computeGradient

        public void computeGradient​(Mat img,
                                    Mat grad,
                                    Mat angleOfs)
        Computes gradients and quantized gradient orientations.
        引数:
        img - 計算対象の画像を格納した行列
        grad - 計算された勾配を格納する CV_32FC2 型の行列
        angleOfs - 量子化された勾配方向を格納する CV_8UC2 型の行列
      • getDefaultPeopleDetector

        public static MatOfFloat getDefaultPeopleDetector()
        Returns coefficients of the classifier trained for people detection (for 64x128 windows).
        戻り値:
        自動生成
      • getDaimlerPeopleDetector

        public static MatOfFloat getDaimlerPeopleDetector()
        Returns coefficients of the classifier trained for people detection (for 48x96 windows).
        戻り値:
        自動生成
      • get_winSize

        public Size get_winSize()
      • get_blockSize

        public Size get_blockSize()
      • get_blockStride

        public Size get_blockStride()
      • get_cellSize

        public Size get_cellSize()
      • get_nbins

        public int get_nbins()
      • get_derivAperture

        public int get_derivAperture()
      • get_winSigma

        public double get_winSigma()
      • get_histogramNormType

        public int get_histogramNormType()
      • get_L2HysThreshold

        public double get_L2HysThreshold()
      • get_gammaCorrection

        public boolean get_gammaCorrection()
      • get_svmDetector

        public MatOfFloat get_svmDetector()
      • get_nlevels

        public int get_nlevels()
      • get_signedGradient

        public boolean get_signedGradient()