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

クラス Imgproc


  • public class Imgproc
    extends java.lang.Object
    • コンストラクタの詳細

      • Imgproc

        public Imgproc()
    • メソッドの詳細

      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale,
                                                                    double sigma_scale,
                                                                    double quant,
                                                                    double ang_th,
                                                                    double log_eps,
                                                                    double density_th,
                                                                    int n_bins)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        sigma_scale - ガウシアンフィルタのシグマ。sigma = sigma_scale/scale として計算される。
        quant - 勾配ノルムの量子化誤差に対する境界。
        ang_th - 勾配角度の許容誤差(度単位)。
        log_eps - 検出のしきい値: -log10(NFA) > log_eps。高度なリファインメントを選択した場合にのみ使用される。
        density_th - 外接矩形内で整列した領域点が占める最小密度。
        n_bins - 勾配強度の擬似的な順序付けにおけるビンの数。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale,
                                                                    double sigma_scale,
                                                                    double quant,
                                                                    double ang_th,
                                                                    double log_eps,
                                                                    double density_th)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        sigma_scale - ガウシアンフィルタのシグマ。sigma = sigma_scale/scale として計算される。
        quant - 勾配ノルムの量子化誤差に対する境界。
        ang_th - 勾配角度の許容誤差(度単位)。
        log_eps - 検出のしきい値: -log10(NFA) > log_eps。高度なリファインメントを選択した場合にのみ使用される。
        density_th - 外接矩形内で整列した領域点が占める最小密度。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale,
                                                                    double sigma_scale,
                                                                    double quant,
                                                                    double ang_th,
                                                                    double log_eps)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        sigma_scale - ガウシアンフィルタのシグマ。sigma = sigma_scale/scale として計算される。
        quant - 勾配ノルムの量子化誤差に対する境界。
        ang_th - 勾配角度の許容誤差(度単位)。
        log_eps - 検出のしきい値: -log10(NFA) > log_eps。高度なリファインメントを選択した場合にのみ使用される。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale,
                                                                    double sigma_scale,
                                                                    double quant,
                                                                    double ang_th)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        sigma_scale - ガウシアンフィルタのシグマ。sigma = sigma_scale/scale として計算される。
        quant - 勾配ノルムの量子化誤差に対する境界。
        ang_th - 勾配角度の許容誤差(度単位)。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale,
                                                                    double sigma_scale,
                                                                    double quant)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        sigma_scale - ガウシアンフィルタのシグマ。sigma = sigma_scale/scale として計算される。
        quant - 勾配ノルムの量子化誤差に対する境界。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale,
                                                                    double sigma_scale)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        sigma_scale - ガウシアンフィルタのシグマ。sigma = sigma_scale/scale として計算される。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine,
                                                                    double scale)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        scale - 線分の検出に使用される画像のスケール。範囲は (0..1]。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector​(int refine)
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        引数:
        refine - 検出された線分を絞り込む方法。#LineSegmentDetectorModes を参照。
        戻り値:
        自動生成
      • createLineSegmentDetector

        public static LineSegmentDetector createLineSegmentDetector()
        Creates a smart pointer to a LineSegmentDetector object and initializes it. The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want to edit those, as to tailor it for their own application.
        戻り値:
        自動生成
      • getGaussianKernel

        public static Mat getGaussianKernel​(int ksize,
                                            double sigma,
                                            int ktype)
        Returns Gaussian filter coefficients. The function computes and returns the \(\texttt{ksize} \times 1\) matrix of Gaussian filter coefficients: \(G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},\) where \(i=0..\texttt{ksize}-1\) and \(\alpha\) is the scale factor chosen so that \(\sum_i G_i=1\). Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly. You may also use the higher-level GaussianBlur.
        引数:
        ksize - アパーチャサイズ。奇数( \(\texttt{ksize} \mod 2 = 1\) )かつ正である必要がある。
        sigma - ガウス分布の標準偏差。非正の値の場合、ksizeから sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8 として計算される。
        ktype - フィルタ係数の型。CV_32F または CV_64F が指定できる。 SEE: sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur
        戻り値:
        自動生成
      • getGaussianKernel

        public static Mat getGaussianKernel​(int ksize,
                                            double sigma)
        Returns Gaussian filter coefficients. The function computes and returns the \(\texttt{ksize} \times 1\) matrix of Gaussian filter coefficients: \(G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},\) where \(i=0..\texttt{ksize}-1\) and \(\alpha\) is the scale factor chosen so that \(\sum_i G_i=1\). Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly. You may also use the higher-level GaussianBlur.
        引数:
        ksize - アパーチャサイズ。奇数( \(\texttt{ksize} \mod 2 = 1\) )かつ正である必要がある。
        sigma - ガウス分布の標準偏差。非正の値の場合、ksizeから sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8 として計算される。 SEE: sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur
        戻り値:
        自動生成
      • getDerivKernels

        public static void getDerivKernels​(Mat kx,
                                           Mat ky,
                                           int dx,
                                           int dy,
                                           int ksize,
                                           boolean normalize,
                                           int ktype)
        Returns filter coefficients for computing spatial image derivatives. The function computes and returns the filter coefficients for spatial image derivatives. When ksize=FILTER_SCHARR, the Scharr \(3 \times 3\) kernels are generated (see #Scharr). Otherwise, Sobel kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
        引数:
        kx - 行フィルタ係数の出力行列。型は ktype である。
        ky - 列フィルタ係数の出力行列。型は ktype である。
        dx - x方向に関する微分の階数。
        dy - y方向に関する微分の階数。
        ksize - アパーチャサイズ。FILTER_SCHARR, 1, 3, 5, または 7 が指定できる。
        normalize - フィルタ係数を正規化(縮小)するかどうかを示すフラグ。理論上、係数の分母は \(=2^{ksize*2-dx-dy-2}\) となるべきである。浮動小数点画像をフィルタリングする場合は、正規化されたカーネルを使うのが一般的である。しかし、8ビット画像の微分を計算して結果を16ビット画像に格納し、すべての小数部のビットを保持したい場合は、normalize=false を設定するとよい。
        ktype - フィルタ係数の型。CV_32f または CV_64F が指定できる。
      • getDerivKernels

        public static void getDerivKernels​(Mat kx,
                                           Mat ky,
                                           int dx,
                                           int dy,
                                           int ksize,
                                           boolean normalize)
        Returns filter coefficients for computing spatial image derivatives. The function computes and returns the filter coefficients for spatial image derivatives. When ksize=FILTER_SCHARR, the Scharr \(3 \times 3\) kernels are generated (see #Scharr). Otherwise, Sobel kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
        引数:
        kx - 行フィルタ係数の出力行列。型は ktype である。
        ky - 列フィルタ係数の出力行列。型は ktype である。
        dx - x方向に関する微分の階数。
        dy - y方向に関する微分の階数。
        ksize - アパーチャサイズ。FILTER_SCHARR, 1, 3, 5, または 7 が指定できる。
        normalize - フィルタ係数を正規化(縮小)するかどうかを示すフラグ。理論上、係数の分母は \(=2^{ksize*2-dx-dy-2}\) となるべきである。浮動小数点画像をフィルタリングする場合は、正規化されたカーネルを使うのが一般的である。しかし、8ビット画像の微分を計算して結果を16ビット画像に格納し、すべての小数部のビットを保持したい場合は、normalize=false を設定するとよい。
      • getDerivKernels

        public static void getDerivKernels​(Mat kx,
                                           Mat ky,
                                           int dx,
                                           int dy,
                                           int ksize)
        Returns filter coefficients for computing spatial image derivatives. The function computes and returns the filter coefficients for spatial image derivatives. When ksize=FILTER_SCHARR, the Scharr \(3 \times 3\) kernels are generated (see #Scharr). Otherwise, Sobel kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
        引数:
        kx - 行フィルタ係数の出力行列。型は ktype である。
        ky - 列フィルタ係数の出力行列。型は ktype である。
        dx - x方向に関する微分の階数。
        dy - y方向に関する微分の階数。
        ksize - アパーチャサイズ。FILTER_SCHARR, 1, 3, 5, または 7 が指定できる。理論上、係数の分母は \(=2^{ksize*2-dx-dy-2}\) となるべきである。浮動小数点画像をフィルタリングする場合は、正規化されたカーネルを使うのが一般的である。しかし、8ビット画像の微分を計算して結果を16ビット画像に格納し、すべての小数部のビットを保持したい場合は、normalize=false を設定するとよい。
      • getGaborKernel

        public static Mat getGaborKernel​(Size ksize,
                                         double sigma,
                                         double theta,
                                         double lambd,
                                         double gamma,
                                         double psi,
                                         int ktype)
        Returns Gabor filter coefficients. For more details about gabor filter equations and parameters, see: [Gabor Filter](https://en.wikipedia.org/wiki/Gabor_filter).
        引数:
        ksize - 返されるフィルタのサイズ。
        sigma - ガウシアン包絡線の標準偏差。
        theta - ガボール関数の平行な縞模様に対する法線の向き。
        lambd - 正弦波因子の波長。
        gamma - 空間的なアスペクト比。
        psi - 位相オフセット。
        ktype - フィルタ係数の型。CV_32F または CV_64F が指定できる。
        戻り値:
        自動生成
      • getGaborKernel

        public static Mat getGaborKernel​(Size ksize,
                                         double sigma,
                                         double theta,
                                         double lambd,
                                         double gamma,
                                         double psi)
        Returns Gabor filter coefficients. For more details about gabor filter equations and parameters, see: [Gabor Filter](https://en.wikipedia.org/wiki/Gabor_filter).
        引数:
        ksize - 返されるフィルタのサイズ。
        sigma - ガウシアン包絡線の標準偏差。
        theta - ガボール関数の平行な縞模様に対する法線の向き。
        lambd - 正弦波因子の波長。
        gamma - 空間的なアスペクト比。
        psi - 位相オフセット。
        戻り値:
        自動生成
      • getGaborKernel

        public static Mat getGaborKernel​(Size ksize,
                                         double sigma,
                                         double theta,
                                         double lambd,
                                         double gamma)
        Returns Gabor filter coefficients. For more details about gabor filter equations and parameters, see: [Gabor Filter](https://en.wikipedia.org/wiki/Gabor_filter).
        引数:
        ksize - 返されるフィルタのサイズ。
        sigma - ガウシアン包絡線の標準偏差。
        theta - ガボール関数の平行な縞模様に対する法線の向き。
        lambd - 正弦波因子の波長。
        gamma - 空間的なアスペクト比。
        戻り値:
        自動生成
      • getStructuringElement

        public static Mat getStructuringElement​(int shape,
                                                Size ksize,
                                                Point anchor)
        Returns a structuring element of the specified size and shape for morphological operations. The function constructs and returns the structuring element that can be further passed to #erode, #dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as the structuring element.
        引数:
        shape - 要素の形状。#MorphShapes のいずれかを指定できる。
        ksize - 構造要素のサイズ。
        anchor - 要素内におけるアンカーの位置。デフォルト値 \((-1, -1)\) はアンカーが中心にあることを意味する。十字形の要素の形状のみがアンカー位置に依存する点に注意。それ以外の場合、アンカーはモルフォロジー演算の結果がどれだけシフトするかを調整するだけである。
        戻り値:
        自動生成
      • getStructuringElement

        public static Mat getStructuringElement​(int shape,
                                                Size ksize)
        Returns a structuring element of the specified size and shape for morphological operations. The function constructs and returns the structuring element that can be further passed to #erode, #dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as the structuring element.
        引数:
        shape - 要素の形状。#MorphShapes のいずれかを指定できる。
        ksize - 構造要素のサイズ。アンカーは中心にある。十字形の要素の形状のみがアンカー位置に依存する点に注意。それ以外の場合、アンカーはモルフォロジー演算の結果がどれだけシフトするかを調整するだけである。
        戻り値:
        自動生成
      • medianBlur

        public static void medianBlur​(Mat src,
                                      Mat dst,
                                      int ksize)
        Blurs an image using the median filter. The function smoothes an image using the median filter with the \(\texttt{ksize} \times \texttt{ksize}\) aperture. Each channel of a multi-channel image is processed independently. In-place operation is supported. 覚え書き: The median filter uses #BORDER_REPLICATE internally to cope with border pixels, see #BorderTypes
        引数:
        src - 入力1, 3, または4チャンネル画像。ksize が 3 または 5 のとき、画像のビット深度は CV_8U, CV_16U, または CV_32F でなければならない。より大きいアパーチャサイズの場合は CV_8U のみ指定できる。
        dst - src と同じサイズおよび型の出力配列。
        ksize - アパーチャの一辺の長さ。奇数かつ1より大きい必要がある。例: 3, 5, 7 ... SEE: bilateralFilter, blur, boxFilter, GaussianBlur
      • GaussianBlur

        public static void GaussianBlur​(Mat src,
                                        Mat dst,
                                        Size ksize,
                                        double sigmaX,
                                        double sigmaY,
                                        int borderType,
                                        int hint)
        Blurs an image using a Gaussian filter. The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - ガウシアンカーネルのサイズ。ksize.width と ksize.height は異なってもよいが、いずれも正の奇数でなければならない。あるいは両方を0にして sigma から計算させることもできる。
        sigmaX - X方向のガウシアンカーネルの標準偏差。
        sigmaY - Y方向のガウシアンカーネルの標準偏差。sigmaY が0の場合は sigmaX と等しい値に設定される。両方のシグマが0の場合は、それぞれ ksize.width と ksize.height から計算される(詳細は #getGaussianKernel を参照)。これらのセマンティクスが将来変更される可能性に関わらず結果を完全に制御するには、ksize, sigmaX, sigmaY のすべてを指定することを推奨する。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
        hint - 実装の変更を指定するフラグ。#AlgorithmHint を参照。 SEE: sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur
      • GaussianBlur

        public static void GaussianBlur​(Mat src,
                                        Mat dst,
                                        Size ksize,
                                        double sigmaX,
                                        double sigmaY,
                                        int borderType)
        Blurs an image using a Gaussian filter. The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - ガウシアンカーネルのサイズ。ksize.width と ksize.height は異なってもよいが、いずれも正の奇数でなければならない。あるいは両方を0にして sigma から計算させることもできる。
        sigmaX - X方向のガウシアンカーネルの標準偏差。
        sigmaY - Y方向のガウシアンカーネルの標準偏差。sigmaY が0の場合は sigmaX と等しい値に設定される。両方のシグマが0の場合は、それぞれ ksize.width と ksize.height から計算される(詳細は #getGaussianKernel を参照)。これらのセマンティクスが将来変更される可能性に関わらず結果を完全に制御するには、ksize, sigmaX, sigmaY のすべてを指定することを推奨する。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 SEE: sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur
      • GaussianBlur

        public static void GaussianBlur​(Mat src,
                                        Mat dst,
                                        Size ksize,
                                        double sigmaX,
                                        double sigmaY)
        Blurs an image using a Gaussian filter. The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - ガウシアンカーネルのサイズ。ksize.width と ksize.height は異なってもよいが、いずれも正の奇数でなければならない。あるいは両方を0にして sigma から計算させることもできる。
        sigmaX - X方向のガウシアンカーネルの標準偏差。
        sigmaY - Y方向のガウシアンカーネルの標準偏差。sigmaY が0の場合は sigmaX と等しい値に設定される。両方のシグマが0の場合は、それぞれ ksize.width と ksize.height から計算される(詳細は #getGaussianKernel を参照)。これらのセマンティクスが将来変更される可能性に関わらず結果を完全に制御するには、ksize, sigmaX, sigmaY のすべてを指定することを推奨する。 SEE: sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur
      • GaussianBlur

        public static void GaussianBlur​(Mat src,
                                        Mat dst,
                                        Size ksize,
                                        double sigmaX)
        Blurs an image using a Gaussian filter. The function convolves the source image with the specified Gaussian kernel. In-place filtering is supported.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - ガウシアンカーネルのサイズ。ksize.width と ksize.height は異なってもよいが、いずれも正の奇数でなければならない。あるいは両方を0にして sigma から計算させることもできる。
        sigmaX - X方向のガウシアンカーネルの標準偏差。sigmaX と等しい値となり、両方のシグマが0の場合は、それぞれ ksize.width と ksize.height から計算される(詳細は #getGaussianKernel を参照)。これらのセマンティクスが将来変更される可能性に関わらず結果を完全に制御するには、ksize, sigmaX, sigmaY のすべてを指定することを推奨する。 SEE: sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur
      • bilateralFilter

        public static void bilateralFilter​(Mat src,
                                           Mat dst,
                                           int d,
                                           double sigmaColor,
                                           double sigmaSpace,
                                           int borderType)
        Applies the bilateral filter to an image. The function applies bilateral filtering to the input image, as described in https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters. _Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (< 10), the filter will not have much effect, whereas if they are large (> 150), they will have a very strong effect, making the image look "cartoonish". _Filter size_: Large filters (d > 5) are very slow, so it is recommended to use d=5 for real-time applications, and perhaps d=9 for offline applications that need heavy noise filtering. This filter does not work inplace.
        引数:
        src - 入力画像。8ビットまたは浮動小数点の、1チャンネルまたは3チャンネル画像。
        dst - src と同じサイズおよび型の出力画像。
        d - フィルタリング時に使用される各ピクセル近傍の直径。非正の値の場合は sigmaSpace から計算される。
        sigmaColor - 色空間におけるフィルタのシグマ。この引数の値が大きいほど、ピクセル近傍内(sigmaSpace 参照)でより離れた色どうしが混ざり合い、半均一な色の領域が広くなる。
        sigmaSpace - 座標空間におけるフィルタのシグマ。この引数の値が大きいほど、色が十分に近い限りより離れたピクセルどうしが影響し合う(sigmaColor 参照)。d>0 のときは sigmaSpace に関わらず近傍サイズを指定する。それ以外の場合、d は sigmaSpace に比例する。
        borderType - 画像外のピクセルを外挿するために使用される境界モード。#BorderTypes を参照。
      • bilateralFilter

        public static void bilateralFilter​(Mat src,
                                           Mat dst,
                                           int d,
                                           double sigmaColor,
                                           double sigmaSpace)
        Applies the bilateral filter to an image. The function applies bilateral filtering to the input image, as described in https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters. _Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (< 10), the filter will not have much effect, whereas if they are large (> 150), they will have a very strong effect, making the image look "cartoonish". _Filter size_: Large filters (d > 5) are very slow, so it is recommended to use d=5 for real-time applications, and perhaps d=9 for offline applications that need heavy noise filtering. This filter does not work inplace.
        引数:
        src - 入力画像。8ビットまたは浮動小数点の、1チャンネルまたは3チャンネル画像。
        dst - src と同じサイズおよび型の出力画像。
        d - フィルタリング時に使用される各ピクセル近傍の直径。非正の値の場合は sigmaSpace から計算される。
        sigmaColor - 色空間におけるフィルタのシグマ。この引数の値が大きいほど、ピクセル近傍内(sigmaSpace 参照)でより離れた色どうしが混ざり合い、半均一な色の領域が広くなる。
        sigmaSpace - 座標空間におけるフィルタのシグマ。この引数の値が大きいほど、色が十分に近い限りより離れたピクセルどうしが影響し合う(sigmaColor 参照)。d>0 のときは sigmaSpace に関わらず近傍サイズを指定する。それ以外の場合、d は sigmaSpace に比例する。
      • boxFilter

        public static void boxFilter​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     Size ksize,
                                     Point anchor,
                                     boolean normalize,
                                     int borderType)
        Blurs an image using the box filter. The function smooths an image using the kernel: \(\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}\) where \(\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}\) Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび型の出力画像。
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)。
        ksize - 平滑化カーネルのサイズ。
        anchor - アンカー点。デフォルト値 Point(-1,-1) はアンカーがカーネルの中心にあることを意味する。
        normalize - カーネルをその面積で正規化するかどうかを指定するフラグ。
        borderType - 画像外のピクセルを外挿するために使用される境界モード。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 SEE: blur, bilateralFilter, GaussianBlur, medianBlur, integral
      • boxFilter

        public static void boxFilter​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     Size ksize,
                                     Point anchor,
                                     boolean normalize)
        Blurs an image using the box filter. The function smooths an image using the kernel: \(\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}\) where \(\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}\) Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび型の出力画像。
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)。
        ksize - 平滑化カーネルのサイズ。
        anchor - アンカー点。デフォルト値 Point(-1,-1) はアンカーがカーネルの中心にあることを意味する。
        normalize - カーネルをその面積で正規化するかどうかを指定するフラグ。 SEE: blur, bilateralFilter, GaussianBlur, medianBlur, integral
      • boxFilter

        public static void boxFilter​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     Size ksize,
                                     Point anchor)
        Blurs an image using the box filter. The function smooths an image using the kernel: \(\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}\) where \(\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}\) Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび型の出力画像。
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)。
        ksize - 平滑化カーネルのサイズ。
        anchor - アンカー点。デフォルト値 Point(-1,-1) はアンカーがカーネルの中心にあることを意味する。 SEE: blur, bilateralFilter, GaussianBlur, medianBlur, integral
      • boxFilter

        public static void boxFilter​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     Size ksize)
        Blurs an image using the box filter. The function smooths an image using the kernel: \(\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}\) where \(\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}\) Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび型の出力画像。
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)。
        ksize - 平滑化カーネルのサイズ。中心。 SEE: blur, bilateralFilter, GaussianBlur, medianBlur, integral
      • sqrBoxFilter

        public static void sqrBoxFilter​(Mat src,
                                        Mat dst,
                                        int ddepth,
                                        Size ksize,
                                        Point anchor,
                                        boolean normalize,
                                        int borderType)
        Calculates the normalized sum of squares of the pixel values overlapping the filter. For every pixel \( (x, y) \) in the source image, the function calculates the sum of squares of those neighboring pixel values which overlap the filter placed over the pixel \( (x, y) \). The unnormalized square box filter can be useful in computing local image statistics such as the local variance and standard deviation around the neighborhood of a pixel.
        引数:
        src - 入力画像
        dst - src と同じサイズおよび型の出力画像
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)
        ksize - カーネルサイズ
        anchor - カーネルのアンカー点。デフォルト値 Point(-1, -1) はアンカーがカーネルの中心にあることを示す。
        normalize - カーネルをその面積で正規化するかどうかを指定するフラグ。
        borderType - 画像外のピクセルを外挿するために使用される境界モード。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 SEE: boxFilter
      • sqrBoxFilter

        public static void sqrBoxFilter​(Mat src,
                                        Mat dst,
                                        int ddepth,
                                        Size ksize,
                                        Point anchor,
                                        boolean normalize)
        Calculates the normalized sum of squares of the pixel values overlapping the filter. For every pixel \( (x, y) \) in the source image, the function calculates the sum of squares of those neighboring pixel values which overlap the filter placed over the pixel \( (x, y) \). The unnormalized square box filter can be useful in computing local image statistics such as the local variance and standard deviation around the neighborhood of a pixel.
        引数:
        src - 入力画像
        dst - src と同じサイズおよび型の出力画像
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)
        ksize - カーネルサイズ
        anchor - カーネルのアンカー点。デフォルト値 Point(-1, -1) はアンカーがカーネルの中心にあることを示す。
        normalize - カーネルをその面積で正規化するかどうかを指定するフラグ。 SEE: boxFilter
      • sqrBoxFilter

        public static void sqrBoxFilter​(Mat src,
                                        Mat dst,
                                        int ddepth,
                                        Size ksize,
                                        Point anchor)
        Calculates the normalized sum of squares of the pixel values overlapping the filter. For every pixel \( (x, y) \) in the source image, the function calculates the sum of squares of those neighboring pixel values which overlap the filter placed over the pixel \( (x, y) \). The unnormalized square box filter can be useful in computing local image statistics such as the local variance and standard deviation around the neighborhood of a pixel.
        引数:
        src - 入力画像
        dst - src と同じサイズおよび型の出力画像
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)
        ksize - カーネルサイズ
        anchor - カーネルのアンカー点。デフォルト値 Point(-1, -1) はアンカーがカーネルの中心にあることを示す。 SEE: boxFilter
      • sqrBoxFilter

        public static void sqrBoxFilter​(Mat src,
                                        Mat dst,
                                        int ddepth,
                                        Size ksize)
        Calculates the normalized sum of squares of the pixel values overlapping the filter. For every pixel \( (x, y) \) in the source image, the function calculates the sum of squares of those neighboring pixel values which overlap the filter placed over the pixel \( (x, y) \). The unnormalized square box filter can be useful in computing local image statistics such as the local variance and standard deviation around the neighborhood of a pixel.
        引数:
        src - 入力画像
        dst - src と同じサイズおよび型の出力画像
        ddepth - 出力画像のビット深度(-1 で src.depth() を使用)
        ksize - カーネルサイズ。中心。 SEE: boxFilter
      • blur

        public static void blur​(Mat src,
                                Mat dst,
                                Size ksize,
                                Point anchor,
                                int borderType)
        Blurs an image using the normalized box filter. The function smooths an image using the kernel: \(\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}\) The call blur(src, dst, ksize, anchor, borderType) is equivalent to `boxFilter(src, dst, src.type(), ksize, anchor, true, borderType)`.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - 平滑化カーネルのサイズ。
        anchor - アンカー点。デフォルト値 Point(-1,-1) はアンカーがカーネルの中心にあることを意味する。
        borderType - 画像外のピクセルを外挿するために使用される境界モード。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 SEE: boxFilter, bilateralFilter, GaussianBlur, medianBlur
      • blur

        public static void blur​(Mat src,
                                Mat dst,
                                Size ksize,
                                Point anchor)
        Blurs an image using the normalized box filter. The function smooths an image using the kernel: \(\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}\) The call blur(src, dst, ksize, anchor, borderType) is equivalent to `boxFilter(src, dst, src.type(), ksize, anchor, true, borderType)`.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - 平滑化カーネルのサイズ。
        anchor - アンカー点。デフォルト値 Point(-1,-1) はアンカーがカーネルの中心にあることを意味する。 SEE: boxFilter, bilateralFilter, GaussianBlur, medianBlur
      • blur

        public static void blur​(Mat src,
                                Mat dst,
                                Size ksize)
        Blurs an image using the normalized box filter. The function smooths an image using the kernel: \(\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}\) The call blur(src, dst, ksize, anchor, borderType) is equivalent to `boxFilter(src, dst, src.type(), ksize, anchor, true, borderType)`.
        引数:
        src - 入力画像。任意のチャンネル数を持つことができ、各チャンネルは独立して処理される。ただしビット深度は CV_8U, CV_16U, CV_16S, CV_32F, または CV_64F でなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - 平滑化カーネルのサイズ。中心。 SEE: boxFilter, bilateralFilter, GaussianBlur, medianBlur
      • stackBlur

        public static void stackBlur​(Mat src,
                                     Mat dst,
                                     Size ksize)
        Blurs an image using the stackBlur. The function applies and stackBlur to an image. stackBlur can generate similar results as Gaussian blur, and the time consumption does not increase with the increase of kernel size. It creates a kind of moving stack of colors whilst scanning through the image. Thereby it just has to add one new block of color to the right side of the stack and remove the leftmost color. The remaining colors on the topmost layer of the stack are either added on or reduced by one, depending on if they are on the right or on the left side of the stack. The only supported borderType is BORDER_REPLICATE. Original paper was proposed by Mario Klingemann, which can be found https://underdestruction.com/2004/02/25/stackblur-2004.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度は CV_8U, CV_16U, CV_16S, CV_32F のいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        ksize - スタックブラーのカーネルサイズ。ksize.width と ksize.height は異なってもよいが、いずれも正の奇数でなければならない。
      • filter2D

        public static void filter2D​(Mat src,
                                    Mat dst,
                                    int ddepth,
                                    Mat kernel,
                                    Point anchor,
                                    double delta,
                                    int borderType)
        Convolves an image with the kernel. The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode. The function does actually compute correlation, not the convolution: \(\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\) That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)`. The function uses the DFT-based algorithm in case of sufficiently large kernels (~11 x 11 or larger) and the direct algorithm for small kernels.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        kernel - 畳み込みカーネル(より正確には相関カーネル)。シングルチャンネルの浮動小数点行列。チャンネルごとに異なるカーネルを適用したい場合は、split を使って画像を個々の色平面に分割し、それぞれを個別に処理する。
        anchor - カーネル内でフィルタ対象点の相対位置を示すカーネルのアンカー。アンカーはカーネル内に存在しなければならない。デフォルト値 (-1,-1) はアンカーがカーネルの中心にあることを意味する。
        delta - フィルタ処理されたピクセルを dst に格納する前に加算する省略可能な値。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。SEE: sepFilter2D, dft, matchTemplate
      • filter2D

        public static void filter2D​(Mat src,
                                    Mat dst,
                                    int ddepth,
                                    Mat kernel,
                                    Point anchor,
                                    double delta)
        Convolves an image with the kernel. The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode. The function does actually compute correlation, not the convolution: \(\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\) That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)`. The function uses the DFT-based algorithm in case of sufficiently large kernels (~11 x 11 or larger) and the direct algorithm for small kernels.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        kernel - 畳み込みカーネル(より正確には相関カーネル)。シングルチャンネルの浮動小数点行列。チャンネルごとに異なるカーネルを適用したい場合は、split を使って画像を個々の色平面に分割し、それぞれを個別に処理する。
        anchor - カーネル内でフィルタ対象点の相対位置を示すカーネルのアンカー。アンカーはカーネル内に存在しなければならない。デフォルト値 (-1,-1) はアンカーがカーネルの中心にあることを意味する。
        delta - フィルタ処理されたピクセルを dst に格納する前に加算する省略可能な値。SEE: sepFilter2D, dft, matchTemplate
      • filter2D

        public static void filter2D​(Mat src,
                                    Mat dst,
                                    int ddepth,
                                    Mat kernel,
                                    Point anchor)
        Convolves an image with the kernel. The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode. The function does actually compute correlation, not the convolution: \(\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\) That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)`. The function uses the DFT-based algorithm in case of sufficiently large kernels (~11 x 11 or larger) and the direct algorithm for small kernels.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        kernel - 畳み込みカーネル(より正確には相関カーネル)。シングルチャンネルの浮動小数点行列。チャンネルごとに異なるカーネルを適用したい場合は、split を使って画像を個々の色平面に分割し、それぞれを個別に処理する。
        anchor - カーネル内でフィルタ対象点の相対位置を示すカーネルのアンカー。アンカーはカーネル内に存在しなければならない。デフォルト値 (-1,-1) はアンカーがカーネルの中心にあることを意味する。SEE: sepFilter2D, dft, matchTemplate
      • filter2D

        public static void filter2D​(Mat src,
                                    Mat dst,
                                    int ddepth,
                                    Mat kernel)
        Convolves an image with the kernel. The function applies an arbitrary linear filter to an image. In-place operation is supported. When the aperture is partially outside the image, the function interpolates outlier pixel values according to the specified border mode. The function does actually compute correlation, not the convolution: \(\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\) That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - anchor.y - 1)`. The function uses the DFT-based algorithm in case of sufficiently large kernels (~11 x 11 or larger) and the direct algorithm for small kernels.
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        kernel - 畳み込みカーネル(より正確には相関カーネル)。シングルチャンネルの浮動小数点行列。チャンネルごとに異なるカーネルを適用したい場合は、split を使って画像を個々の色平面に分割し、それぞれを個別に処理する。カーネル。アンカーはカーネル内に存在しなければならない。デフォルト値 (-1,-1) はアンカーがカーネルの中心にあることを意味する。SEE: sepFilter2D, dft, matchTemplate
      • sepFilter2D

        public static void sepFilter2D​(Mat src,
                                       Mat dst,
                                       int ddepth,
                                       Mat kernelX,
                                       Mat kernelY,
                                       Point anchor,
                                       double delta,
                                       int borderType)
        Applies a separable linear filter to an image. The function applies a separable linear filter to the image. That is, first, every row of src is filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel kernelY. The final result shifted by delta is stored in dst .
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        kernelX - 各行をフィルタ処理するための係数。
        kernelY - 各列をフィルタ処理するための係数。
        anchor - カーネル内でのアンカー位置。デフォルト値 \((-1,-1)\) はアンカーがカーネルの中心にあることを意味する。
        delta - フィルタ処理した結果を格納する前に加算する値。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。SEE: filter2D, Sobel, GaussianBlur, boxFilter, blur
      • sepFilter2D

        public static void sepFilter2D​(Mat src,
                                       Mat dst,
                                       int ddepth,
                                       Mat kernelX,
                                       Mat kernelY,
                                       Point anchor,
                                       double delta)
        Applies a separable linear filter to an image. The function applies a separable linear filter to the image. That is, first, every row of src is filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel kernelY. The final result shifted by delta is stored in dst .
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        kernelX - 各行をフィルタ処理するための係数。
        kernelY - 各列をフィルタ処理するための係数。
        anchor - カーネル内でのアンカー位置。デフォルト値 \((-1,-1)\) はアンカーがカーネルの中心にあることを意味する。
        delta - フィルタ処理した結果を格納する前に加算する値。SEE: filter2D, Sobel, GaussianBlur, boxFilter, blur
      • sepFilter2D

        public static void sepFilter2D​(Mat src,
                                       Mat dst,
                                       int ddepth,
                                       Mat kernelX,
                                       Mat kernelY,
                                       Point anchor)
        Applies a separable linear filter to an image. The function applies a separable linear filter to the image. That is, first, every row of src is filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel kernelY. The final result shifted by delta is stored in dst .
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        kernelX - 各行をフィルタ処理するための係数。
        kernelY - 各列をフィルタ処理するための係数。
        anchor - カーネル内でのアンカー位置。デフォルト値 \((-1,-1)\) はアンカーがカーネルの中心にあることを意味する。SEE: filter2D, Sobel, GaussianBlur, boxFilter, blur
      • sepFilter2D

        public static void sepFilter2D​(Mat src,
                                       Mat dst,
                                       int ddepth,
                                       Mat kernelX,
                                       Mat kernelY)
        Applies a separable linear filter to an image. The function applies a separable linear filter to the image. That is, first, every row of src is filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel kernelY. The final result shifted by delta is stored in dst .
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        kernelX - 各行をフィルタ処理するための係数。
        kernelY - 各列をフィルタ処理するための係数。はカーネルの中心にある。SEE: filter2D, Sobel, GaussianBlur, boxFilter, blur
      • Sobel

        public static void Sobel​(Mat src,
                                 Mat dst,
                                 int ddepth,
                                 int dx,
                                 int dy,
                                 int ksize,
                                 double scale,
                                 double delta,
                                 int borderType)
        Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. In all cases except one, the \(\texttt{ksize} \times \texttt{ksize}\) separable kernel is used to calculate the derivative. When \(\texttt{ksize = 1}\), the \(3 \times 1\) or \(1 \times 3\) kernel is used (that is, no Gaussian smoothing is done). ksize = 1 can only be used for the first or the second x- or y- derivatives. There is also the special value ksize = #FILTER_SCHARR (-1) that corresponds to the \(3\times3\) Scharr filter that may give more accurate results than the \(3\times3\) Sobel. The Scharr aperture is \(\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\) for the x-derivative, or transposed for the y-derivative. The function calculates an image derivative by convolving the image with the appropriate kernel: \(\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\) The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of: \(\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\) The second case corresponds to a kernel of: \(\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。8ビット入力画像の場合は微分値が切り詰められる。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        ksize - 拡張Sobelカーネルのサイズ。1, 3, 5, 7 のいずれかでなければならない。
        scale - 計算された微分値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない(詳細は #getDerivKernels を参照)。
        delta - 結果を dst に格納する前に加算する省略可能なデルタ値。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。SEE: Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar
      • Sobel

        public static void Sobel​(Mat src,
                                 Mat dst,
                                 int ddepth,
                                 int dx,
                                 int dy,
                                 int ksize,
                                 double scale,
                                 double delta)
        Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. In all cases except one, the \(\texttt{ksize} \times \texttt{ksize}\) separable kernel is used to calculate the derivative. When \(\texttt{ksize = 1}\), the \(3 \times 1\) or \(1 \times 3\) kernel is used (that is, no Gaussian smoothing is done). ksize = 1 can only be used for the first or the second x- or y- derivatives. There is also the special value ksize = #FILTER_SCHARR (-1) that corresponds to the \(3\times3\) Scharr filter that may give more accurate results than the \(3\times3\) Sobel. The Scharr aperture is \(\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\) for the x-derivative, or transposed for the y-derivative. The function calculates an image derivative by convolving the image with the appropriate kernel: \(\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\) The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of: \(\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\) The second case corresponds to a kernel of: \(\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。8ビット入力画像の場合は微分値が切り詰められる。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        ksize - 拡張Sobelカーネルのサイズ。1, 3, 5, 7 のいずれかでなければならない。
        scale - 計算された微分値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない(詳細は #getDerivKernels を参照)。
        delta - 結果を dst に格納する前に加算する省略可能なデルタ値。SEE: Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar
      • Sobel

        public static void Sobel​(Mat src,
                                 Mat dst,
                                 int ddepth,
                                 int dx,
                                 int dy,
                                 int ksize,
                                 double scale)
        Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. In all cases except one, the \(\texttt{ksize} \times \texttt{ksize}\) separable kernel is used to calculate the derivative. When \(\texttt{ksize = 1}\), the \(3 \times 1\) or \(1 \times 3\) kernel is used (that is, no Gaussian smoothing is done). ksize = 1 can only be used for the first or the second x- or y- derivatives. There is also the special value ksize = #FILTER_SCHARR (-1) that corresponds to the \(3\times3\) Scharr filter that may give more accurate results than the \(3\times3\) Sobel. The Scharr aperture is \(\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\) for the x-derivative, or transposed for the y-derivative. The function calculates an image derivative by convolving the image with the appropriate kernel: \(\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\) The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of: \(\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\) The second case corresponds to a kernel of: \(\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。8ビット入力画像の場合は微分値が切り詰められる。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        ksize - 拡張Sobelカーネルのサイズ。1, 3, 5, 7 のいずれかでなければならない。
        scale - 計算された微分値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない(詳細は #getDerivKernels を参照)。SEE: Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar
      • Sobel

        public static void Sobel​(Mat src,
                                 Mat dst,
                                 int ddepth,
                                 int dx,
                                 int dy,
                                 int ksize)
        Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. In all cases except one, the \(\texttt{ksize} \times \texttt{ksize}\) separable kernel is used to calculate the derivative. When \(\texttt{ksize = 1}\), the \(3 \times 1\) or \(1 \times 3\) kernel is used (that is, no Gaussian smoothing is done). ksize = 1 can only be used for the first or the second x- or y- derivatives. There is also the special value ksize = #FILTER_SCHARR (-1) that corresponds to the \(3\times3\) Scharr filter that may give more accurate results than the \(3\times3\) Sobel. The Scharr aperture is \(\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\) for the x-derivative, or transposed for the y-derivative. The function calculates an image derivative by convolving the image with the appropriate kernel: \(\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\) The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of: \(\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\) The second case corresponds to a kernel of: \(\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。8ビット入力画像の場合は微分値が切り詰められる。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        ksize - 拡張Sobelカーネルのサイズ。1, 3, 5, 7 のいずれかでなければならない。(詳細は #getDerivKernels を参照)。SEE: Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar
      • Sobel

        public static void Sobel​(Mat src,
                                 Mat dst,
                                 int ddepth,
                                 int dx,
                                 int dy)
        Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator. In all cases except one, the \(\texttt{ksize} \times \texttt{ksize}\) separable kernel is used to calculate the derivative. When \(\texttt{ksize = 1}\), the \(3 \times 1\) or \(1 \times 3\) kernel is used (that is, no Gaussian smoothing is done). ksize = 1 can only be used for the first or the second x- or y- derivatives. There is also the special value ksize = #FILTER_SCHARR (-1) that corresponds to the \(3\times3\) Scharr filter that may give more accurate results than the \(3\times3\) Sobel. The Scharr aperture is \(\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}\) for the x-derivative, or transposed for the y-derivative. The function calculates an image derivative by convolving the image with the appropriate kernel: \(\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}\) The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3) or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first case corresponds to a kernel of: \(\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}\) The second case corresponds to a kernel of: \(\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。8ビット入力画像の場合は微分値が切り詰められる。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。(詳細は #getDerivKernels を参照)。SEE: Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar
      • spatialGradient

        public static void spatialGradient​(Mat src,
                                           Mat dx,
                                           Mat dy,
                                           int ksize,
                                           int borderType)
        Calculates the first order image derivative in both x and y using a Sobel operator Equivalent to calling: Sobel( src, dx, CV_16SC1, 1, 0, 3 ); Sobel( src, dy, CV_16SC1, 0, 1, 3 );
        引数:
        src - 入力画像。
        dx - x方向の1次微分を格納する出力画像。
        dy - y方向の1次微分を格納する出力画像。
        ksize - Sobelカーネルのサイズ。3 でなければならない。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_DEFAULT=#BORDER_REFLECT_101 と #BORDER_REPLICATE のみサポートされている。SEE: Sobel
      • spatialGradient

        public static void spatialGradient​(Mat src,
                                           Mat dx,
                                           Mat dy,
                                           int ksize)
        Calculates the first order image derivative in both x and y using a Sobel operator Equivalent to calling: Sobel( src, dx, CV_16SC1, 1, 0, 3 ); Sobel( src, dy, CV_16SC1, 0, 1, 3 );
        引数:
        src - 入力画像。
        dx - x方向の1次微分を格納する出力画像。
        dy - y方向の1次微分を格納する出力画像。
        ksize - Sobelカーネルのサイズ。3 でなければならない。#BORDER_DEFAULT=#BORDER_REFLECT_101 と #BORDER_REPLICATE のみサポートされている。SEE: Sobel
      • spatialGradient

        public static void spatialGradient​(Mat src,
                                           Mat dx,
                                           Mat dy)
        Calculates the first order image derivative in both x and y using a Sobel operator Equivalent to calling: Sobel( src, dx, CV_16SC1, 1, 0, 3 ); Sobel( src, dy, CV_16SC1, 0, 1, 3 );
        引数:
        src - 入力画像。
        dx - x方向の1次微分を格納する出力画像。
        dy - y方向の1次微分を格納する出力画像。#BORDER_DEFAULT=#BORDER_REFLECT_101 と #BORDER_REPLICATE のみサポートされている。SEE: Sobel
      • Scharr

        public static void Scharr​(Mat src,
                                  Mat dst,
                                  int ddepth,
                                  int dx,
                                  int dy,
                                  double scale,
                                  double delta,
                                  int borderType)
        Calculates the first x- or y- image derivative using Scharr operator. The function computes the first x- or y- spatial image derivative using the Scharr operator. The call \(\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\) is equivalent to \(\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\)
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        scale - 計算された微分値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない(詳細は #getDerivKernels を参照)。
        delta - 結果を dst に格納する前に加算する省略可能なデルタ値。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。SEE: cartToPolar
      • Scharr

        public static void Scharr​(Mat src,
                                  Mat dst,
                                  int ddepth,
                                  int dx,
                                  int dy,
                                  double scale,
                                  double delta)
        Calculates the first x- or y- image derivative using Scharr operator. The function computes the first x- or y- spatial image derivative using the Scharr operator. The call \(\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\) is equivalent to \(\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\)
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        scale - 計算された微分値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない(詳細は #getDerivKernels を参照)。
        delta - 結果を dst に格納する前に加算する省略可能なデルタ値。SEE: cartToPolar
      • Scharr

        public static void Scharr​(Mat src,
                                  Mat dst,
                                  int ddepth,
                                  int dx,
                                  int dy,
                                  double scale)
        Calculates the first x- or y- image derivative using Scharr operator. The function computes the first x- or y- spatial image derivative using the Scharr operator. The call \(\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\) is equivalent to \(\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\)
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。
        scale - 計算された微分値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない(詳細は #getDerivKernels を参照)。SEE: cartToPolar
      • Scharr

        public static void Scharr​(Mat src,
                                  Mat dst,
                                  int ddepth,
                                  int dx,
                                  int dy)
        Calculates the first x- or y- image derivative using Scharr operator. The function computes the first x- or y- spatial image derivative using the Scharr operator. The call \(\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}\) is equivalent to \(\texttt{Sobel(src, dst, ddepth, dx, dy, FILTER_SCHARR, scale, delta, borderType)} .\)
        引数:
        src - 入力画像。
        dst - src と同じサイズおよび同じチャンネル数の出力画像。
        ddepth - 出力画像のビット深度。REF: filter_depths "combinations" を参照。
        dx - x方向の微分の階数。
        dy - y方向の微分の階数。(詳細は #getDerivKernels を参照)。SEE: cartToPolar
      • Laplacian

        public static void Laplacian​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     int ksize,
                                     double scale,
                                     double delta,
                                     int borderType)
        Calculates the Laplacian of an image. The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator: \(\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\) This is done when ksize &gt; 1. When ksize == 1, the Laplacian is computed by filtering the image with the following \(3 \times 3\) aperture: \(\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        ksize - 2次微分フィルタの計算に用いるアパーチャサイズ。詳細は #getDerivKernels を参照。サイズは正の奇数でなければならない。
        scale - 計算されたLaplacian値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない。詳細は #getDerivKernels を参照。
        delta - 結果を dst に格納する前に加算する省略可能なデルタ値。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。SEE: Sobel, Scharr
      • Laplacian

        public static void Laplacian​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     int ksize,
                                     double scale,
                                     double delta)
        Calculates the Laplacian of an image. The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator: \(\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\) This is done when ksize &gt; 1. When ksize == 1, the Laplacian is computed by filtering the image with the following \(3 \times 3\) aperture: \(\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        ksize - 2次微分フィルタの計算に用いるアパーチャサイズ。詳細は #getDerivKernels を参照。サイズは正の奇数でなければならない。
        scale - 計算されたLaplacian値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない。詳細は #getDerivKernels を参照。
        delta - 結果を dst に格納する前に加算する省略可能なデルタ値。SEE: Sobel, Scharr
      • Laplacian

        public static void Laplacian​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     int ksize,
                                     double scale)
        Calculates the Laplacian of an image. The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator: \(\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\) This is done when ksize &gt; 1. When ksize == 1, the Laplacian is computed by filtering the image with the following \(3 \times 3\) aperture: \(\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        ksize - 2次微分フィルタの計算に用いるアパーチャサイズ。詳細は #getDerivKernels を参照。サイズは正の奇数でなければならない。
        scale - 計算されたLaplacian値に対する省略可能なスケール係数。デフォルトではスケーリングは適用されない。詳細は #getDerivKernels を参照。SEE: Sobel, Scharr
      • Laplacian

        public static void Laplacian​(Mat src,
                                     Mat dst,
                                     int ddepth,
                                     int ksize)
        Calculates the Laplacian of an image. The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator: \(\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\) This is done when ksize &gt; 1. When ksize == 1, the Laplacian is computed by filtering the image with the following \(3 \times 3\) aperture: \(\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。
        ksize - 2次微分フィルタの計算に用いるアパーチャサイズ。詳細は #getDerivKernels を参照。サイズは正の奇数でなければならない。は適用されない。詳細は #getDerivKernels を参照。SEE: Sobel, Scharr
      • Laplacian

        public static void Laplacian​(Mat src,
                                     Mat dst,
                                     int ddepth)
        Calculates the Laplacian of an image. The function calculates the Laplacian of the source image by adding up the second x and y derivatives calculated using the Sobel operator: \(\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}\) This is done when ksize &gt; 1. When ksize == 1, the Laplacian is computed by filtering the image with the following \(3 \times 3\) aperture: \(\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}\)
        引数:
        src - 入力画像。
        dst - src と同じサイズ・同じチャンネル数の出力画像。
        ddepth - 出力画像の希望するビット深度。REF: filter_depths "combinations" を参照。詳細。サイズは正の奇数でなければならない。は適用されない。詳細は #getDerivKernels を参照。SEE: Sobel, Scharr
      • Canny

        public static void Canny​(Mat image,
                                 Mat edges,
                                 double threshold1,
                                 double threshold2,
                                 int apertureSize,
                                 boolean L2gradient)
        Finds edges in an image using the Canny algorithm CITE: Canny86 . The function finds edges in the input image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See <https://en.wikipedia.org/wiki/Canny_edge_detector>
        引数:
        image - 8ビット入力画像。
        edges - 出力エッジマップ。image と同じサイズのシングルチャンネル8ビット画像。
        threshold1 - ヒステリシス処理の第1しきい値。
        threshold2 - ヒステリシス処理の第2しきい値。
        apertureSize - Sobel演算子のアパーチャサイズ。
        L2gradient - 画像の勾配強度の計算に、より正確な \(L_2\) ノルム \(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) を使うべきか( L2gradient=true )、それともデフォルトの \(L_1\) ノルム \(=|dI/dx|+|dI/dy|\) で十分か( L2gradient=false )を示すフラグ。
      • Canny

        public static void Canny​(Mat image,
                                 Mat edges,
                                 double threshold1,
                                 double threshold2,
                                 int apertureSize)
        Finds edges in an image using the Canny algorithm CITE: Canny86 . The function finds edges in the input image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See <https://en.wikipedia.org/wiki/Canny_edge_detector>
        引数:
        image - 8ビット入力画像。
        edges - 出力エッジマップ。image と同じサイズのシングルチャンネル8ビット画像。
        threshold1 - ヒステリシス処理の第1しきい値。
        threshold2 - ヒステリシス処理の第2しきい値。
        apertureSize - Sobel演算子のアパーチャサイズ。\(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) を画像の勾配強度の計算に使うべきか( L2gradient=true )、それともデフォルトの \(L_1\) ノルム \(=|dI/dx|+|dI/dy|\) で十分か( L2gradient=false )。
      • Canny

        public static void Canny​(Mat image,
                                 Mat edges,
                                 double threshold1,
                                 double threshold2)
        Finds edges in an image using the Canny algorithm CITE: Canny86 . The function finds edges in the input image and marks them in the output map edges using the Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The largest value is used to find initial segments of strong edges. See <https://en.wikipedia.org/wiki/Canny_edge_detector>
        引数:
        image - 8ビット入力画像。
        edges - 出力エッジマップ。image と同じサイズのシングルチャンネル8ビット画像。
        threshold1 - ヒステリシス処理の第1しきい値。
        threshold2 - ヒステリシス処理の第2しきい値。\(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) を画像の勾配強度の計算に使うべきか( L2gradient=true )、それともデフォルトの \(L_1\) ノルム \(=|dI/dx|+|dI/dy|\) で十分か( L2gradient=false )。
      • Canny

        public static void Canny​(Mat dx,
                                 Mat dy,
                                 Mat edges,
                                 double threshold1,
                                 double threshold2,
                                 boolean L2gradient)
        \overload Finds edges in an image using the Canny algorithm with custom image gradient.
        引数:
        dx - 入力画像の16ビットx微分(CV_16SC1 または CV_16SC3)。
        dy - 入力画像の16ビットy微分(dx と同じ型)。
        edges - 出力エッジマップ。image と同じサイズのシングルチャンネル8ビット画像。
        threshold1 - ヒステリシス処理の第1しきい値。
        threshold2 - ヒステリシス処理の第2しきい値。
        L2gradient - 画像の勾配強度の計算に、より正確な \(L_2\) ノルム \(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) を使うべきか( L2gradient=true )、それともデフォルトの \(L_1\) ノルム \(=|dI/dx|+|dI/dy|\) で十分か( L2gradient=false )を示すフラグ。
      • Canny

        public static void Canny​(Mat dx,
                                 Mat dy,
                                 Mat edges,
                                 double threshold1,
                                 double threshold2)
        \overload Finds edges in an image using the Canny algorithm with custom image gradient.
        引数:
        dx - 入力画像の16ビットx微分(CV_16SC1 または CV_16SC3)。
        dy - 入力画像の16ビットy微分(dx と同じ型)。
        edges - 出力エッジマップ。image と同じサイズのシングルチャンネル8ビット画像。
        threshold1 - ヒステリシス処理の第1しきい値。
        threshold2 - ヒステリシス処理の第2しきい値。\(=\sqrt{(dI/dx)^2 + (dI/dy)^2}\) を画像の勾配強度の計算に使うべきか( L2gradient=true )、それともデフォルトの \(L_1\) ノルム \(=|dI/dx|+|dI/dy|\) で十分か( L2gradient=false )。
      • cornerMinEigenVal

        public static void cornerMinEigenVal​(Mat src,
                                             Mat dst,
                                             int blockSize,
                                             int ksize,
                                             int borderType)
        Calculates the minimal eigenvalue of gradient matrices for corner detection. The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal eigenvalue of the covariance matrix of derivatives, that is, \(\min(\lambda_1, \lambda_2)\) in terms of the formulae in the cornerEigenValsAndVecs description.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 最小固有値を格納する画像。型は CV_32FC1 で、src と同じサイズを持つ。
        blockSize - 近傍サイズ(詳細は #cornerEigenValsAndVecs を参照)。
        ksize - Sobel演算子のアパーチャパラメータ。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
      • cornerMinEigenVal

        public static void cornerMinEigenVal​(Mat src,
                                             Mat dst,
                                             int blockSize,
                                             int ksize)
        Calculates the minimal eigenvalue of gradient matrices for corner detection. The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal eigenvalue of the covariance matrix of derivatives, that is, \(\min(\lambda_1, \lambda_2)\) in terms of the formulae in the cornerEigenValsAndVecs description.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 最小固有値を格納する画像。型は CV_32FC1 で、src と同じサイズを持つ。
        blockSize - 近傍サイズ(詳細は #cornerEigenValsAndVecs を参照)。
        ksize - Sobel演算子のアパーチャパラメータ。
      • cornerMinEigenVal

        public static void cornerMinEigenVal​(Mat src,
                                             Mat dst,
                                             int blockSize)
        Calculates the minimal eigenvalue of gradient matrices for corner detection. The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal eigenvalue of the covariance matrix of derivatives, that is, \(\min(\lambda_1, \lambda_2)\) in terms of the formulae in the cornerEigenValsAndVecs description.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 最小固有値を格納する画像。型は CV_32FC1 で、src と同じサイズを持つ。
        blockSize - 近傍サイズ(詳細は #cornerEigenValsAndVecs を参照)。
      • cornerHarris

        public static void cornerHarris​(Mat src,
                                        Mat dst,
                                        int blockSize,
                                        int ksize,
                                        double k,
                                        int borderType)
        Harris corner detector. The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and cornerEigenValsAndVecs , for each pixel \((x, y)\) it calculates a \(2\times2\) gradient covariance matrix \(M^{(x,y)}\) over a \(\texttt{blockSize} \times \texttt{blockSize}\) neighborhood. Then, it computes the following characteristic: \(\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2\) Corners in the image can be found as the local maxima of this response map.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - Harris検出器の応答を格納する画像。型は CV_32FC1 で、src と同じサイズを持つ。
        blockSize - 近傍サイズ(詳細は #cornerEigenValsAndVecs を参照)。
        ksize - Sobel演算子のアパーチャパラメータ。
        k - Harris検出器の自由パラメータ。上記の式を参照。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
      • cornerHarris

        public static void cornerHarris​(Mat src,
                                        Mat dst,
                                        int blockSize,
                                        int ksize,
                                        double k)
        Harris corner detector. The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and cornerEigenValsAndVecs , for each pixel \((x, y)\) it calculates a \(2\times2\) gradient covariance matrix \(M^{(x,y)}\) over a \(\texttt{blockSize} \times \texttt{blockSize}\) neighborhood. Then, it computes the following characteristic: \(\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2\) Corners in the image can be found as the local maxima of this response map.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - Harris検出器の応答を格納する画像。型は CV_32FC1 で、src と同じサイズを持つ。
        blockSize - 近傍サイズ(詳細は #cornerEigenValsAndVecs を参照)。
        ksize - Sobel演算子のアパーチャパラメータ。
        k - Harris検出器の自由パラメータ。上記の式を参照。
      • cornerEigenValsAndVecs

        public static void cornerEigenValsAndVecs​(Mat src,
                                                  Mat dst,
                                                  int blockSize,
                                                  int ksize,
                                                  int borderType)
        Calculates eigenvalues and eigenvectors of image blocks for corner detection. For every pixel \(p\) , the function cornerEigenValsAndVecs considers a blockSize \(\times\) blockSize neighborhood \(S(p)\) . It calculates the covariation matrix of derivatives over the neighborhood as: \(M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}\) where the derivatives are computed using the Sobel operator. After that, it finds eigenvectors and eigenvalues of \(M\) and stores them in the destination image as \((\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)\) where
        • \(\lambda_1, \lambda_2\) は \(M\) のソートされていない固有値
        • \(x_1, y_1\) は \(\lambda_1\) に対応する固有ベクトル
        • \(x_2, y_2\) は \(\lambda_2\) に対応する固有ベクトル
        The output of the function can be used for robust edge or corner detection.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 結果を格納する画像。src と同じサイズで、型は CV_32FC(6) を持つ。
        blockSize - 近傍サイズ(以下の詳細を参照)。
        ksize - Sobel演算子のアパーチャパラメータ。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。SEE: cornerMinEigenVal, cornerHarris, preCornerDetect
      • cornerEigenValsAndVecs

        public static void cornerEigenValsAndVecs​(Mat src,
                                                  Mat dst,
                                                  int blockSize,
                                                  int ksize)
        Calculates eigenvalues and eigenvectors of image blocks for corner detection. For every pixel \(p\) , the function cornerEigenValsAndVecs considers a blockSize \(\times\) blockSize neighborhood \(S(p)\) . It calculates the covariation matrix of derivatives over the neighborhood as: \(M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}\) where the derivatives are computed using the Sobel operator. After that, it finds eigenvectors and eigenvalues of \(M\) and stores them in the destination image as \((\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)\) where
        • \(\lambda_1, \lambda_2\) は \(M\) のソートされていない固有値
        • \(x_1, y_1\) は \(\lambda_1\) に対応する固有ベクトル
        • \(x_2, y_2\) は \(\lambda_2\) に対応する固有ベクトル
        The output of the function can be used for robust edge or corner detection.
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 結果を格納する画像。src と同じサイズで、型は CV_32FC(6) を持つ。
        blockSize - 近傍サイズ(以下の詳細を参照)。
        ksize - Sobel演算子のアパーチャパラメータ。SEE: cornerMinEigenVal, cornerHarris, preCornerDetect
      • preCornerDetect

        public static void preCornerDetect​(Mat src,
                                           Mat dst,
                                           int ksize,
                                           int borderType)
        Calculates a feature map for corner detection. The function calculates the complex spatial derivative-based function of the source image \(\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}\) where \(D_x\),\(D_y\) are the first image derivatives, \(D_{xx}\),\(D_{yy}\) are the second image derivatives, and \(D_{xy}\) is the mixed derivative. The corners can be found as local maximums of the functions, as shown below: Mat corners, dilated_corners; preCornerDetect(image, corners, 3); // dilation with 3x3 rectangular structuring element dilate(corners, dilated_corners, Mat(), 1); Mat corner_mask = corners == dilated_corners;
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 型がCV_32Fでsrcと同じサイズの出力画像。
        ksize - Sobelの%開口サイズ。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
      • preCornerDetect

        public static void preCornerDetect​(Mat src,
                                           Mat dst,
                                           int ksize)
        Calculates a feature map for corner detection. The function calculates the complex spatial derivative-based function of the source image \(\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}\) where \(D_x\),\(D_y\) are the first image derivatives, \(D_{xx}\),\(D_{yy}\) are the second image derivatives, and \(D_{xy}\) is the mixed derivative. The corners can be found as local maximums of the functions, as shown below: Mat corners, dilated_corners; preCornerDetect(image, corners, 3); // dilation with 3x3 rectangular structuring element dilate(corners, dilated_corners, Mat(), 1); Mat corner_mask = corners == dilated_corners;
        引数:
        src - 入力シングルチャンネル8ビットまたは浮動小数点画像。
        dst - 型がCV_32Fでsrcと同じサイズの出力画像。
        ksize - Sobelの%開口サイズ。
      • cornerSubPix

        public static void cornerSubPix​(Mat image,
                                        Mat corners,
                                        Size winSize,
                                        Size zeroZone,
                                        TermCriteria criteria)
        Refines the corner locations. The function iterates to find the sub-pixel accurate location of corners or radial saddle points as described in CITE: forstner1987fast, and as shown on the figure below. ![image](pics/cornersubpix.png) Sub-pixel accurate corner locator is based on the observation that every vector from the center \(q\) to a point \(p\) located within a neighborhood of \(q\) is orthogonal to the image gradient at \(p\) subject to image and measurement noise. Consider the expression: \(\epsilon _i = {DI_{p_i}}^T \cdot (q - p_i)\) where \({DI_{p_i}}\) is an image gradient at one of the points \(p_i\) in a neighborhood of \(q\) . The value of \(q\) is to be found so that \(\epsilon_i\) is minimized. A system of equations may be set up with \(\epsilon_i\) set to zero: \(\sum _i(DI_{p_i} \cdot {DI_{p_i}}^T) \cdot q - \sum _i(DI_{p_i} \cdot {DI_{p_i}}^T \cdot p_i)\) where the gradients are summed within a neighborhood ("search window") of \(q\) . Calling the first gradient term \(G\) and the second gradient term \(b\) gives: \(q = G^{-1} \cdot b\) The algorithm sets the center of the neighborhood window at this new center \(q\) and then iterates until the center stays within a set threshold.
        引数:
        image - 入力するシングルチャンネルの8ビットまたは浮動小数点画像。
        corners - 入力コーナーの初期座標であり、出力として精緻化された座標が返される。
        winSize - 探索ウィンドウの一辺の長さの半分。たとえばwinSize=Size(5,5)の場合、\((5*2+1) \times (5*2+1) = 11 \times 11\) の探索ウィンドウが使用される。
        zeroZone - 探索領域の中央にあるデッドゾーンのサイズの半分。この領域では以下の式における総和計算が行われない。自己相関行列の特異点の発生を回避するために用いられることがある。値が(-1,-1)の場合はそのようなサイズが存在しないことを示す。
        criteria - コーナー精緻化の反復処理を終了するための基準。すなわち、コーナー位置の精緻化処理は、criteria.maxCount回の反復後、またはある反復でコーナー位置の移動量がcriteria.epsilon未満になったときに停止する。
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask,
                                               int blockSize,
                                               boolean useHarrisDetector,
                                               double k)
        Determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region, as described in CITE: Shi94
        • この関数は、#cornerMinEigenValまたは#cornerHarrisを用いて、ソース画像の各ピクセルにおけるコーナー品質尺度を計算する。
        • この関数は非極大抑制を行う(*3 x 3* の近傍内の局所最大値が残される)。
        • 最小固有値が \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) 未満のコーナーは棄却される。
        • 残りのコーナーは品質尺度の降順でソートされる。
        • 関数は、maxDistance より近い距離により強いコーナーが存在する各コーナーを破棄する。
        The function can be used to initialize a point-based tracker of an object. 覚え書き: If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 省略可能な関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。
        useHarrisDetector - Harris検出器(#cornerHarrisを参照)と#cornerMinEigenValのどちらを使用するかを示す引数。
        k - Harris検出器の自由引数。SEE: cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask,
                                               int blockSize,
                                               boolean useHarrisDetector)
        Determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region, as described in CITE: Shi94
        • この関数は、#cornerMinEigenValまたは#cornerHarrisを用いて、ソース画像の各ピクセルにおけるコーナー品質尺度を計算する。
        • この関数は非極大抑制を行う(*3 x 3* の近傍内の局所最大値が残される)。
        • 最小固有値が \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) 未満のコーナーは棄却される。
        • 残りのコーナーは品質尺度の降順でソートされる。
        • 関数は、maxDistance より近い距離により強いコーナーが存在する各コーナーを破棄する。
        The function can be used to initialize a point-based tracker of an object. 覚え書き: If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 省略可能な関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。
        useHarrisDetector - Harris検出器(#cornerHarrisを参照)と#cornerMinEigenValのどちらを使用するかを示す引数。SEE: cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask,
                                               int blockSize)
        Determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region, as described in CITE: Shi94
        • この関数は、#cornerMinEigenValまたは#cornerHarrisを用いて、ソース画像の各ピクセルにおけるコーナー品質尺度を計算する。
        • この関数は非極大抑制を行う(*3 x 3* の近傍内の局所最大値が残される)。
        • 最小固有値が \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) 未満のコーナーは棄却される。
        • 残りのコーナーは品質尺度の降順でソートされる。
        • 関数は、maxDistance より近い距離により強いコーナーが存在する各コーナーを破棄する。
        The function can be used to initialize a point-based tracker of an object. 覚え書き: If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 省略可能な関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。または#cornerMinEigenVal。SEE: cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask)
        Determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region, as described in CITE: Shi94
        • この関数は、#cornerMinEigenValまたは#cornerHarrisを用いて、ソース画像の各ピクセルにおけるコーナー品質尺度を計算する。
        • この関数は非極大抑制を行う(*3 x 3* の近傍内の局所最大値が残される)。
        • 最小固有値が \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) 未満のコーナーは棄却される。
        • 残りのコーナーは品質尺度の降順でソートされる。
        • 関数は、maxDistance より近い距離により強いコーナーが存在する各コーナーを破棄する。
        The function can be used to initialize a point-based tracker of an object. 覚え書き: If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 省略可能な関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。ピクセル近傍。cornerEigenValsAndVecsを参照。または#cornerMinEigenVal。SEE: cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance)
        Determines strong corners on an image. The function finds the most prominent corners in the image or in the specified image region, as described in CITE: Shi94
        • この関数は、#cornerMinEigenValまたは#cornerHarrisを用いて、ソース画像の各ピクセルにおけるコーナー品質尺度を計算する。
        • この関数は非極大抑制を行う(*3 x 3* の近傍内の局所最大値が残される)。
        • 最小固有値が \(\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)\) 未満のコーナーは棄却される。
        • 残りのコーナーは品質尺度の降順でソートされる。
        • 関数は、maxDistance より近い距離により強いコーナーが存在する各コーナーを破棄する。
        The function can be used to initialize a point-based tracker of an object. 覚え書き: If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。CV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。ピクセル近傍。cornerEigenValsAndVecsを参照。または#cornerMinEigenVal。SEE: cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask,
                                               int blockSize,
                                               int gradientSize,
                                               boolean useHarrisDetector,
                                               double k)
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask,
                                               int blockSize,
                                               int gradientSize,
                                               boolean useHarrisDetector)
      • goodFeaturesToTrack

        public static void goodFeaturesToTrack​(Mat image,
                                               MatOfPoint corners,
                                               int maxCorners,
                                               double qualityLevel,
                                               double minDistance,
                                               Mat mask,
                                               int blockSize,
                                               int gradientSize)
      • goodFeaturesToTrackWithQuality

        public static void goodFeaturesToTrackWithQuality​(Mat image,
                                                          Mat corners,
                                                          int maxCorners,
                                                          double qualityLevel,
                                                          double minDistance,
                                                          Mat mask,
                                                          Mat cornersQuality,
                                                          int blockSize,
                                                          int gradientSize,
                                                          boolean useHarrisDetector,
                                                          double k)
        Same as above, but returns also quality measure of the detected corners.
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        cornersQuality - 検出されたコーナーの品質尺度の出力ベクトル。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。
        gradientSize - 微分計算に用いるSobel演算子の開口引数。cornerEigenValsAndVecsを参照。
        useHarrisDetector - Harris検出器(#cornerHarrisを参照)と#cornerMinEigenValのどちらを使用するかを示す引数。
        k - Harris検出器の自由引数。
      • goodFeaturesToTrackWithQuality

        public static void goodFeaturesToTrackWithQuality​(Mat image,
                                                          Mat corners,
                                                          int maxCorners,
                                                          double qualityLevel,
                                                          double minDistance,
                                                          Mat mask,
                                                          Mat cornersQuality,
                                                          int blockSize,
                                                          int gradientSize,
                                                          boolean useHarrisDetector)
        Same as above, but returns also quality measure of the detected corners.
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        cornersQuality - 検出されたコーナーの品質尺度の出力ベクトル。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。
        gradientSize - 微分計算に用いるSobel演算子の開口引数。cornerEigenValsAndVecsを参照。
        useHarrisDetector - Harris検出器(#cornerHarrisを参照)と#cornerMinEigenValのどちらを使用するかを示す引数。
      • goodFeaturesToTrackWithQuality

        public static void goodFeaturesToTrackWithQuality​(Mat image,
                                                          Mat corners,
                                                          int maxCorners,
                                                          double qualityLevel,
                                                          double minDistance,
                                                          Mat mask,
                                                          Mat cornersQuality,
                                                          int blockSize,
                                                          int gradientSize)
        Same as above, but returns also quality measure of the detected corners.
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        cornersQuality - 検出されたコーナーの品質尺度の出力ベクトル。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。
        gradientSize - 微分計算に用いるSobel演算子の開口引数。cornerEigenValsAndVecsを参照。または#cornerMinEigenVal。
      • goodFeaturesToTrackWithQuality

        public static void goodFeaturesToTrackWithQuality​(Mat image,
                                                          Mat corners,
                                                          int maxCorners,
                                                          double qualityLevel,
                                                          double minDistance,
                                                          Mat mask,
                                                          Mat cornersQuality,
                                                          int blockSize)
        Same as above, but returns also quality measure of the detected corners.
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        cornersQuality - 検出されたコーナーの品質尺度の出力ベクトル。
        blockSize - 各ピクセル近傍において微分の共変動行列を計算するための平均ブロックのサイズ。cornerEigenValsAndVecsを参照。cornerEigenValsAndVecsを参照。または#cornerMinEigenVal。
      • goodFeaturesToTrackWithQuality

        public static void goodFeaturesToTrackWithQuality​(Mat image,
                                                          Mat corners,
                                                          int maxCorners,
                                                          double qualityLevel,
                                                          double minDistance,
                                                          Mat mask,
                                                          Mat cornersQuality)
        Same as above, but returns also quality measure of the detected corners.
        引数:
        image - 入力する8ビットまたは浮動小数点32ビットのシングルチャンネル画像。
        corners - 検出されたコーナーの出力ベクトル。
        maxCorners - 返すコーナーの最大数。見つかったコーナーがこれより多い場合は、最も強いものが返される。maxCorners &lt;= 0 の場合は最大数に制限を設けず、検出されたすべてのコーナーが返される。
        qualityLevel - 受け入れるコーナー品質の最小値を表す引数。この引数の値は、最良のコーナー品質尺度(最小固有値(#cornerMinEigenValを参照)またはHarris関数の応答(#cornerHarrisを参照))に掛けられる。品質尺度がこの積より小さいコーナーは棄却される。たとえば、最良コーナーの品質尺度が1500でqualityLevel=0.01の場合、品質尺度が15未満のすべてのコーナーが棄却される。
        minDistance - 返されるコーナー間の最小ユークリッド距離。
        mask - 関心領域(ROI)。画像が空でない場合(型がCV_8UC1でimageと同じサイズである必要がある)、コーナーを検出する領域を指定する。
        cornersQuality - 検出されたコーナーの品質尺度の出力ベクトル。ピクセル近傍。cornerEigenValsAndVecsを参照。cornerEigenValsAndVecsを参照。または#cornerMinEigenVal。
      • HoughLines

        public static void HoughLines​(Mat image,
                                      Mat lines,
                                      double rho,
                                      double theta,
                                      int threshold,
                                      double srn,
                                      double stn,
                                      double min_theta,
                                      double max_theta,
                                      boolean use_edgeval)
        Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough transform.
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は2要素または3要素のベクトル \((\rho, \theta)\) または \((\rho, \theta, \textrm{votes})\) で表される。ここで \(\rho\) は座標原点 \((0,0)\)(画像の左上隅)からの距離、\(\theta\) はラジアン単位の直線回転角(\(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\))、\(\textrm{votes}\) はアキュムレータの値である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        srn - マルチスケールHough変換において、距離分解能rhoに対する除数。粗いアキュムレータの距離分解能はrhoで、正確なアキュムレータの分解能はrho/srnである。srn=0かつstn=0の場合は、古典的なHough変換が使用される。それ以外の場合は、これら両方の引数が正でなければならない。
        stn - マルチスケールHough変換において、距離分解能thetaに対する除数。
        min_theta - 標準およびマルチスケールHough変換において、直線を探索する最小角度。0からmax_thetaの間でなければならない。
        max_theta - 標準およびマルチスケールHough変換における角度の上限。min_thetaからCV_PIの間でなければならない。アキュムレータ内の実際の最大角度は、引数min_thetaおよびthetaに応じてmax_thetaよりわずかに小さくなる場合がある。
        use_edgeval - 重み付きHough変換を使用したい場合はtrue。
      • HoughLines

        public static void HoughLines​(Mat image,
                                      Mat lines,
                                      double rho,
                                      double theta,
                                      int threshold,
                                      double srn,
                                      double stn,
                                      double min_theta,
                                      double max_theta)
        Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough transform.
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は2要素または3要素のベクトル \((\rho, \theta)\) または \((\rho, \theta, \textrm{votes})\) で表される。ここで \(\rho\) は座標原点 \((0,0)\)(画像の左上隅)からの距離、\(\theta\) はラジアン単位の直線回転角(\(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\))、\(\textrm{votes}\) はアキュムレータの値である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        srn - マルチスケールHough変換において、距離分解能rhoに対する除数。粗いアキュムレータの距離分解能はrhoで、正確なアキュムレータの分解能はrho/srnである。srn=0かつstn=0の場合は、古典的なHough変換が使用される。それ以外の場合は、これら両方の引数が正でなければならない。
        stn - マルチスケールHough変換において、距離分解能thetaに対する除数。
        min_theta - 標準およびマルチスケールHough変換において、直線を探索する最小角度。0からmax_thetaの間でなければならない。
        max_theta - 標準およびマルチスケールHough変換における角度の上限。min_thetaからCV_PIの間でなければならない。アキュムレータ内の実際の最大角度は、引数min_thetaおよびthetaに応じてmax_thetaよりわずかに小さくなる場合がある。
      • HoughLines

        public static void HoughLines​(Mat image,
                                      Mat lines,
                                      double rho,
                                      double theta,
                                      int threshold,
                                      double srn,
                                      double stn,
                                      double min_theta)
        Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough transform.
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は2要素または3要素のベクトル \((\rho, \theta)\) または \((\rho, \theta, \textrm{votes})\) で表される。ここで \(\rho\) は座標原点 \((0,0)\)(画像の左上隅)からの距離、\(\theta\) はラジアン単位の直線回転角(\(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\))、\(\textrm{votes}\) はアキュムレータの値である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        srn - マルチスケールHough変換において、距離分解能rhoに対する除数。粗いアキュムレータの距離分解能はrhoで、正確なアキュムレータの分解能はrho/srnである。srn=0かつstn=0の場合は、古典的なHough変換が使用される。それ以外の場合は、これら両方の引数が正でなければならない。
        stn - マルチスケールHough変換において、距離分解能thetaに対する除数。
        min_theta - 標準およびマルチスケールHough変換において、直線を探索する最小角度。0からmax_thetaの間でなければならない。min_thetaからCV_PIの間でなければならない。アキュムレータ内の実際の最大角度は、引数min_thetaおよびthetaに応じてmax_thetaよりわずかに小さくなる場合がある。
      • HoughLines

        public static void HoughLines​(Mat image,
                                      Mat lines,
                                      double rho,
                                      double theta,
                                      int threshold,
                                      double srn,
                                      double stn)
        Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough transform.
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は2要素または3要素のベクトル \((\rho, \theta)\) または \((\rho, \theta, \textrm{votes})\) で表される。ここで \(\rho\) は座標原点 \((0,0)\)(画像の左上隅)からの距離、\(\theta\) はラジアン単位の直線回転角(\(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\))、\(\textrm{votes}\) はアキュムレータの値である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        srn - マルチスケールHough変換において、距離分解能rhoに対する除数。粗いアキュムレータの距離分解能はrhoで、正確なアキュムレータの分解能はrho/srnである。srn=0かつstn=0の場合は、古典的なHough変換が使用される。それ以外の場合は、これら両方の引数が正でなければならない。
        stn - マルチスケールHough変換において、距離分解能thetaに対する除数。0からmax_thetaの間でなければならない。min_thetaからCV_PIの間でなければならない。アキュムレータ内の実際の最大角度は、引数min_thetaおよびthetaに応じてmax_thetaよりわずかに小さくなる場合がある。
      • HoughLines

        public static void HoughLines​(Mat image,
                                      Mat lines,
                                      double rho,
                                      double theta,
                                      int threshold,
                                      double srn)
        Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough transform.
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は2要素または3要素のベクトル \((\rho, \theta)\) または \((\rho, \theta, \textrm{votes})\) で表される。ここで \(\rho\) は座標原点 \((0,0)\)(画像の左上隅)からの距離、\(\theta\) はラジアン単位の直線回転角(\(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\))、\(\textrm{votes}\) はアキュムレータの値である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        srn - マルチスケールHough変換において、距離分解能rhoに対する除数。粗いアキュムレータの距離分解能はrhoで、正確なアキュムレータの分解能はrho/srnである。srn=0かつstn=0の場合は、古典的なHough変換が使用される。それ以外の場合は、これら両方の引数が正でなければならない。0からmax_thetaの間でなければならない。min_thetaからCV_PIの間でなければならない。アキュムレータ内の実際の最大角度は、引数min_thetaおよびthetaに応じてmax_thetaよりわずかに小さくなる場合がある。
      • HoughLines

        public static void HoughLines​(Mat image,
                                      Mat lines,
                                      double rho,
                                      double theta,
                                      int threshold)
        Finds lines in a binary image using the standard Hough transform. The function implements the standard or standard multi-scale Hough transform algorithm for line detection. See <https://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough transform.
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は2要素または3要素のベクトル \((\rho, \theta)\) または \((\rho, \theta, \textrm{votes})\) で表される。ここで \(\rho\) は座標原点 \((0,0)\)(画像の左上隅)からの距離、\(\theta\) はラジアン単位の直線回転角(\(0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}\))、\(\textrm{votes}\) はアキュムレータの値である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。粗いアキュムレータの距離分解能はrhoで、正確なアキュムレータの分解能はrho/srnである。srn=0かつstn=0の場合は、古典的なHough変換が使用される。それ以外の場合は、これら両方の引数が正でなければならない。0からmax_thetaの間でなければならない。min_thetaからCV_PIの間でなければならない。アキュムレータ内の実際の最大角度は、引数min_thetaおよびthetaに応じてmax_thetaよりわずかに小さくなる場合がある。
      • HoughLinesP

        public static void HoughLinesP​(Mat image,
                                       Mat lines,
                                       double rho,
                                       double theta,
                                       int threshold,
                                       double minLineLength,
                                       double maxLineGap)
        Finds line segments in a binary image using the probabilistic Hough transform. The function implements the probabilistic Hough transform algorithm for line detection, described in CITE: Matas00 See the line detection example below: INCLUDE: snippets/imgproc_HoughLinesP.cpp This is a sample picture the function parameters have been tuned for: ![image](pics/building.jpg) And this is the output of the above program in case of the probabilistic Hough transform: ![image](pics/houghp.png)
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は4要素のベクトル \((x_1, y_1, x_2, y_2)\) で表される。ここで \((x_1,y_1)\) と \((x_2, y_2)\) は検出された各線分の端点である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        minLineLength - 直線の最小長。これより短い線分は棄却される。
        maxLineGap - 同一直線上の点を連結するために許容される点間の最大ギャップ。SEE: LineSegmentDetector
      • HoughLinesP

        public static void HoughLinesP​(Mat image,
                                       Mat lines,
                                       double rho,
                                       double theta,
                                       int threshold,
                                       double minLineLength)
        Finds line segments in a binary image using the probabilistic Hough transform. The function implements the probabilistic Hough transform algorithm for line detection, described in CITE: Matas00 See the line detection example below: INCLUDE: snippets/imgproc_HoughLinesP.cpp This is a sample picture the function parameters have been tuned for: ![image](pics/building.jpg) And this is the output of the above program in case of the probabilistic Hough transform: ![image](pics/houghp.png)
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は4要素のベクトル \((x_1, y_1, x_2, y_2)\) で表される。ここで \((x_1,y_1)\) と \((x_2, y_2)\) は検出された各線分の端点である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        minLineLength - 直線の最小長。これより短い線分は棄却される。SEE: LineSegmentDetector
      • HoughLinesP

        public static void HoughLinesP​(Mat image,
                                       Mat lines,
                                       double rho,
                                       double theta,
                                       int threshold)
        Finds line segments in a binary image using the probabilistic Hough transform. The function implements the probabilistic Hough transform algorithm for line detection, described in CITE: Matas00 See the line detection example below: INCLUDE: snippets/imgproc_HoughLinesP.cpp This is a sample picture the function parameters have been tuned for: ![image](pics/building.jpg) And this is the output of the above program in case of the probabilistic Hough transform: ![image](pics/houghp.png)
        引数:
        image - 8ビットのシングルチャンネル二値ソース画像。この画像は関数によって変更される場合がある。
        lines - 直線の出力ベクトル。各直線は4要素のベクトル \((x_1, y_1, x_2, y_2)\) で表される。ここで \((x_1,y_1)\) と \((x_2, y_2)\) は検出された各線分の端点である。
        rho - アキュムレータの距離分解能(ピクセル単位)。
        theta - アキュムレータの角度分解能(ラジアン単位)。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。SEE: LineSegmentDetector
      • HoughLinesPointSet

        public static void HoughLinesPointSet​(Mat point,
                                              Mat lines,
                                              int lines_max,
                                              int threshold,
                                              double min_rho,
                                              double max_rho,
                                              double rho_step,
                                              double min_theta,
                                              double max_theta,
                                              double theta_step)
        Finds lines in a set of points using the standard Hough transform. The function finds lines in a set of points using a modification of the Hough transform. INCLUDE: snippets/imgproc_HoughLinesPointSet.cpp
        引数:
        point - 点の入力ベクトル。各ベクトルはPointベクトル \((x,y)\) としてエンコードされている必要がある。型はCV_32FC2またはCV_32SC2でなければならない。
        lines - 見つかった直線の出力ベクトル。各ベクトルはvector<Vec3d> \((votes, rho, theta)\) としてエンコードされる。'votes'の値が大きいほど、Hough直線の信頼性が高い。
        lines_max - Hough直線の最大数。
        threshold - %アキュムレータのしきい値引数。十分な投票数(\(>\texttt{threshold}\))を得た直線のみが返される。
        min_rho - アキュムレータにおける \(\rho\) の最小値(注意: \(\rho\) は負になりうる。絶対値 \(|\rho|\) は直線から原点までの距離である)。
        max_rho - アキュムレータにおける \(\rho\) の最大値。
        rho_step - アキュムレータの距離分解能。
        min_theta - アキュムレータの最小角度値(ラジアン単位)。
        max_theta - アキュムレータの角度値の上限(ラジアン単位)。実際の最大角度は、引数min_thetaおよびtheta_stepに応じてmax_thetaよりわずかに小さくなる場合がある。
        theta_step - アキュムレータの角度分解能(ラジアン単位)。
      • HoughCircles

        public static void HoughCircles​(Mat image,
                                        Mat circles,
                                        int method,
                                        double dp,
                                        double minDist,
                                        double param1,
                                        double param2,
                                        int minRadius,
                                        int maxRadius)
        Finds circles in a grayscale image using the Hough transform. The function finds circles in a grayscale image using a modification of the Hough transform. Example: : INCLUDE: snippets/imgproc_HoughLinesCircles.cpp 覚え書き: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number to return centers only without radius search, and find the correct radius using an additional procedure. It also helps to smooth image a bit unless it's already soft. For example, GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
        引数:
        image - 8ビットのシングルチャンネルグレースケール入力画像。
        circles - 見つかった円の出力ベクトル。各ベクトルは3要素または4要素の浮動小数点ベクトル \((x, y, radius)\) または \((x, y, radius, votes)\) としてエンコードされる。
        method - 検出方法。#HoughModesを参照。利用可能な方法は#HOUGH_GRADIENTと#HOUGH_GRADIENT_ALTである。
        dp - 画像分解能に対するアキュムレータ分解能の逆比。たとえばdp=1の場合、アキュムレータは入力画像と同じ分解能を持つ。dp=2の場合、アキュムレータの幅と高さは半分になる。#HOUGH_GRADIENT_ALTでは、非常に小さな円を検出する必要がある場合を除き、推奨値はdp=1.5である。
        minDist - 検出される円の中心間の最小距離。この引数が小さすぎると、真の円に加えて複数の近接した円が誤検出される場合がある。大きすぎると、一部の円が見逃される場合がある。
        param1 - 1つ目のメソッド固有引数。#HOUGH_GRADIENTおよび#HOUGH_GRADIENT_ALTの場合は、Cannyエッジ検出器に渡される2つのしきい値のうち高い方である(低い方はその半分)。#HOUGH_GRADIENT_ALTは画像の微分計算に#Scharrアルゴリズムを使用するため、しきい値は通常より高く、300程度、または通常の露出でコントラストのある画像向けに設定すべきである点に注意。
        param2 - 2つ目のメソッド固有引数。#HOUGH_GRADIENTの場合は、検出段階における円の中心に対するアキュムレータのしきい値である。これが小さいほど、より多くの偽の円が検出される可能性がある。アキュムレータ値が大きい円ほど先に返される。#HOUGH_GRADIENT_ALTアルゴリズムの場合、これは円の「完全さ」を表す尺度である。1に近いほど、アルゴリズムはより整った形の円を選択する。ほとんどの場合0.9で問題ない。小さな円をより良く検出したい場合は、0.85、0.8、あるいはそれ以下に下げてもよい。ただしその場合は、多数の偽の円を避けるため、探索範囲 [minRadius, maxRadius] を制限することも試みること。
        minRadius - 円の最小半径。
        maxRadius - 円の最大半径。<= 0 の場合は画像の最大寸法を使用する。< 0 の場合、#HOUGH_GRADIENTは半径を求めずに中心を返す。#HOUGH_GRADIENT_ALTは常に円の半径を計算する。SEE: fitEllipse, minEnclosingCircle
      • HoughCircles

        public static void HoughCircles​(Mat image,
                                        Mat circles,
                                        int method,
                                        double dp,
                                        double minDist,
                                        double param1,
                                        double param2,
                                        int minRadius)
        Finds circles in a grayscale image using the Hough transform. The function finds circles in a grayscale image using a modification of the Hough transform. Example: : INCLUDE: snippets/imgproc_HoughLinesCircles.cpp 覚え書き: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number to return centers only without radius search, and find the correct radius using an additional procedure. It also helps to smooth image a bit unless it's already soft. For example, GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
        引数:
        image - 8ビットのシングルチャンネルグレースケール入力画像。
        circles - 見つかった円の出力ベクトル。各ベクトルは3要素または4要素の浮動小数点ベクトル \((x, y, radius)\) または \((x, y, radius, votes)\) としてエンコードされる。
        method - 検出方法。#HoughModesを参照。利用可能な方法は#HOUGH_GRADIENTと#HOUGH_GRADIENT_ALTである。
        dp - 画像分解能に対するアキュムレータ分解能の逆比。たとえばdp=1の場合、アキュムレータは入力画像と同じ分解能を持つ。dp=2の場合、アキュムレータの幅と高さは半分になる。#HOUGH_GRADIENT_ALTでは、非常に小さな円を検出する必要がある場合を除き、推奨値はdp=1.5である。
        minDist - 検出される円の中心間の最小距離。この引数が小さすぎると、真の円に加えて複数の近接した円が誤検出される場合がある。大きすぎると、一部の円が見逃される場合がある。
        param1 - 1つ目のメソッド固有引数。#HOUGH_GRADIENTおよび#HOUGH_GRADIENT_ALTの場合は、Cannyエッジ検出器に渡される2つのしきい値のうち高い方である(低い方はその半分)。#HOUGH_GRADIENT_ALTは画像の微分計算に#Scharrアルゴリズムを使用するため、しきい値は通常より高く、300程度、または通常の露出でコントラストのある画像向けに設定すべきである点に注意。
        param2 - 2つ目のメソッド固有引数。#HOUGH_GRADIENTの場合は、検出段階における円の中心に対するアキュムレータのしきい値である。これが小さいほど、より多くの偽の円が検出される可能性がある。アキュムレータ値が大きい円ほど先に返される。#HOUGH_GRADIENT_ALTアルゴリズムの場合、これは円の「完全さ」を表す尺度である。1に近いほど、アルゴリズムはより整った形の円を選択する。ほとんどの場合0.9で問題ない。小さな円をより良く検出したい場合は、0.85、0.8、あるいはそれ以下に下げてもよい。ただしその場合は、多数の偽の円を避けるため、探索範囲 [minRadius, maxRadius] を制限することも試みること。
        minRadius - 円の最小半径。半径を求めずに中心を返す。#HOUGH_GRADIENT_ALTは常に円の半径を計算する。SEE: fitEllipse, minEnclosingCircle
      • HoughCircles

        public static void HoughCircles​(Mat image,
                                        Mat circles,
                                        int method,
                                        double dp,
                                        double minDist,
                                        double param1,
                                        double param2)
        Finds circles in a grayscale image using the Hough transform. The function finds circles in a grayscale image using a modification of the Hough transform. Example: : INCLUDE: snippets/imgproc_HoughLinesCircles.cpp 覚え書き: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number to return centers only without radius search, and find the correct radius using an additional procedure. It also helps to smooth image a bit unless it's already soft. For example, GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
        引数:
        image - 8ビットのシングルチャンネルグレースケール入力画像。
        circles - 見つかった円の出力ベクトル。各ベクトルは3要素または4要素の浮動小数点ベクトル \((x, y, radius)\) または \((x, y, radius, votes)\) としてエンコードされる。
        method - 検出方法。#HoughModesを参照。利用可能な方法は#HOUGH_GRADIENTと#HOUGH_GRADIENT_ALTである。
        dp - 画像分解能に対するアキュムレータ分解能の逆比。たとえばdp=1の場合、アキュムレータは入力画像と同じ分解能を持つ。dp=2の場合、アキュムレータの幅と高さは半分になる。#HOUGH_GRADIENT_ALTでは、非常に小さな円を検出する必要がある場合を除き、推奨値はdp=1.5である。
        minDist - 検出される円の中心間の最小距離。この引数が小さすぎると、真の円に加えて複数の近接した円が誤検出される場合がある。大きすぎると、一部の円が見逃される場合がある。
        param1 - 1つ目のメソッド固有引数。#HOUGH_GRADIENTおよび#HOUGH_GRADIENT_ALTの場合は、Cannyエッジ検出器に渡される2つのしきい値のうち高い方である(低い方はその半分)。#HOUGH_GRADIENT_ALTは画像の微分計算に#Scharrアルゴリズムを使用するため、しきい値は通常より高く、300程度、または通常の露出でコントラストのある画像向けに設定すべきである点に注意。
        param2 - 2つ目のメソッド固有引数。#HOUGH_GRADIENTの場合は、検出段階における円の中心に対するアキュムレータのしきい値である。これが小さいほど、より多くの偽の円が検出される可能性がある。アキュムレータ値が大きい円ほど先に返される。#HOUGH_GRADIENT_ALTアルゴリズムの場合、これは円の「完全さ」を表す尺度である。1に近いほど、アルゴリズムはより整った形の円を選択する。ほとんどの場合0.9で問題ない。小さな円をより良く検出したい場合は、0.85、0.8、あるいはそれ以下に下げてもよい。ただしその場合は、多数の偽の円を避けるため、探索範囲 [minRadius, maxRadius] を制限することも試みること。半径を求めずに中心を返す。#HOUGH_GRADIENT_ALTは常に円の半径を計算する。SEE: fitEllipse, minEnclosingCircle
      • HoughCircles

        public static void HoughCircles​(Mat image,
                                        Mat circles,
                                        int method,
                                        double dp,
                                        double minDist,
                                        double param1)
        Finds circles in a grayscale image using the Hough transform. The function finds circles in a grayscale image using a modification of the Hough transform. Example: : INCLUDE: snippets/imgproc_HoughLinesCircles.cpp 覚え書き: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number to return centers only without radius search, and find the correct radius using an additional procedure. It also helps to smooth image a bit unless it's already soft. For example, GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
        引数:
        image - 8ビットのシングルチャンネルグレースケール入力画像。
        circles - 見つかった円の出力ベクトル。各ベクトルは3要素または4要素の浮動小数点ベクトル \((x, y, radius)\) または \((x, y, radius, votes)\) としてエンコードされる。
        method - 検出方法。#HoughModesを参照。利用可能な方法は#HOUGH_GRADIENTと#HOUGH_GRADIENT_ALTである。
        dp - 画像分解能に対するアキュムレータ分解能の逆比。たとえばdp=1の場合、アキュムレータは入力画像と同じ分解能を持つ。dp=2の場合、アキュムレータの幅と高さは半分になる。#HOUGH_GRADIENT_ALTでは、非常に小さな円を検出する必要がある場合を除き、推奨値はdp=1.5である。
        minDist - 検出される円の中心間の最小距離。この引数が小さすぎると、真の円に加えて複数の近接した円が誤検出される場合がある。大きすぎると、一部の円が見逃される場合がある。
        param1 - 1つ目のメソッド固有引数。#HOUGH_GRADIENTおよび#HOUGH_GRADIENT_ALTの場合は、Cannyエッジ検出器に渡される2つのしきい値のうち高い方である(低い方はその半分)。#HOUGH_GRADIENT_ALTは画像の微分計算に#Scharrアルゴリズムを使用するため、しきい値は通常より高く、300程度、または通常の露出でコントラストのある画像向けに設定すべきである点に注意。検出段階における円の中心に対するアキュムレータのしきい値。これが小さいほど、より多くの偽の円が検出される可能性がある。アキュムレータ値が大きい円ほど先に返される。#HOUGH_GRADIENT_ALTアルゴリズムの場合、これは円の「完全さ」を表す尺度である。1に近いほど、アルゴリズムはより整った形の円を選択する。ほとんどの場合0.9で問題ない。小さな円をより良く検出したい場合は、0.85、0.8、あるいはそれ以下に下げてもよい。ただしその場合は、多数の偽の円を避けるため、探索範囲 [minRadius, maxRadius] を制限することも試みること。半径を求めずに中心を返す。#HOUGH_GRADIENT_ALTは常に円の半径を計算する。SEE: fitEllipse, minEnclosingCircle
      • HoughCircles

        public static void HoughCircles​(Mat image,
                                        Mat circles,
                                        int method,
                                        double dp,
                                        double minDist)
        Finds circles in a grayscale image using the Hough transform. The function finds circles in a grayscale image using a modification of the Hough transform. Example: : INCLUDE: snippets/imgproc_HoughLinesCircles.cpp 覚え書き: Usually the function detects the centers of circles well. However, it may fail to find correct radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if you know it. Or, in the case of #HOUGH_GRADIENT method you may set maxRadius to a negative number to return centers only without radius search, and find the correct radius using an additional procedure. It also helps to smooth image a bit unless it's already soft. For example, GaussianBlur() with 7x7 kernel and 1.5x1.5 sigma or similar blurring may help.
        引数:
        image - 8ビットのシングルチャンネルグレースケール入力画像。
        circles - 見つかった円の出力ベクトル。各ベクトルは3要素または4要素の浮動小数点ベクトル \((x, y, radius)\) または \((x, y, radius, votes)\) としてエンコードされる。
        method - 検出方法。#HoughModesを参照。利用可能な方法は#HOUGH_GRADIENTと#HOUGH_GRADIENT_ALTである。
        dp - 画像分解能に対するアキュムレータ分解能の逆比。たとえばdp=1の場合、アキュムレータは入力画像と同じ分解能を持つ。dp=2の場合、アキュムレータの幅と高さは半分になる。#HOUGH_GRADIENT_ALTでは、非常に小さな円を検出する必要がある場合を除き、推奨値はdp=1.5である。
        minDist - 検出される円の中心間の最小距離。この引数が小さすぎると、真の円に加えて複数の近接した円が誤検出される場合がある。大きすぎると、一部の円が見逃される場合がある。Cannyエッジ検出器に渡される2つのしきい値のうち高い方である(低い方はその半分)。#HOUGH_GRADIENT_ALTは画像の微分計算に#Scharrアルゴリズムを使用するため、しきい値は通常より高く、300程度、または通常の露出でコントラストのある画像向けに設定すべきである点に注意。検出段階における円の中心に対するアキュムレータのしきい値。これが小さいほど、より多くの偽の円が検出される可能性がある。アキュムレータ値が大きい円ほど先に返される。#HOUGH_GRADIENT_ALTアルゴリズムの場合、これは円の「完全さ」を表す尺度である。1に近いほど、アルゴリズムはより整った形の円を選択する。ほとんどの場合0.9で問題ない。小さな円をより良く検出したい場合は、0.85、0.8、あるいはそれ以下に下げてもよい。ただしその場合は、多数の偽の円を避けるため、探索範囲 [minRadius, maxRadius] を制限することも試みること。半径を求めずに中心を返す。#HOUGH_GRADIENT_ALTは常に円の半径を計算する。SEE: fitEllipse, minEnclosingCircle
      • erode

        public static void erode​(Mat src,
                                 Mat dst,
                                 Mat kernel,
                                 Point anchor,
                                 int iterations,
                                 int borderType,
                                 Scalar borderValue)
        Erodes an image by using a specific structuring element. The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken: \(\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 収縮に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは#getStructuringElementを用いて作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。
        iterations - 収縮を適用する回数。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
        borderValue - 境界が定数の場合の境界値 SEE: dilate, morphologyEx, getStructuringElement
      • erode

        public static void erode​(Mat src,
                                 Mat dst,
                                 Mat kernel,
                                 Point anchor,
                                 int iterations,
                                 int borderType)
        Erodes an image by using a specific structuring element. The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken: \(\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 収縮に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは#getStructuringElementを用いて作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。
        iterations - 収縮を適用する回数。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 SEE: dilate, morphologyEx, getStructuringElement
      • erode

        public static void erode​(Mat src,
                                 Mat dst,
                                 Mat kernel,
                                 Point anchor,
                                 int iterations)
        Erodes an image by using a specific structuring element. The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken: \(\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 収縮に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは#getStructuringElementを用いて作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。
        iterations - 収縮を適用する回数。 SEE: dilate, morphologyEx, getStructuringElement
      • erode

        public static void erode​(Mat src,
                                 Mat dst,
                                 Mat kernel,
                                 Point anchor)
        Erodes an image by using a specific structuring element. The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken: \(\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 収縮に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは#getStructuringElementを用いて作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。 SEE: dilate, morphologyEx, getStructuringElement
      • erode

        public static void erode​(Mat src,
                                 Mat dst,
                                 Mat kernel)
        Erodes an image by using a specific structuring element. The function erodes the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the minimum is taken: \(\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 収縮に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは #getStructuringElement を使って作成できる。アンカーは要素の中心にある。 SEE: dilate, morphologyEx, getStructuringElement
      • dilate

        public static void dilate​(Mat src,
                                  Mat dst,
                                  Mat kernel,
                                  Point anchor,
                                  int iterations,
                                  int borderType,
                                  Scalar borderValue)
        Dilates an image by using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken: \(\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 膨張に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは #getStructuringElement を使って作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。
        iterations - 膨張を適用する回数。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
        borderValue - 境界が定数の場合の境界値 SEE: erode, morphologyEx, getStructuringElement
      • dilate

        public static void dilate​(Mat src,
                                  Mat dst,
                                  Mat kernel,
                                  Point anchor,
                                  int iterations,
                                  int borderType)
        Dilates an image by using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken: \(\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 膨張に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは #getStructuringElement を使って作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。
        iterations - 膨張を適用する回数。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 SEE: erode, morphologyEx, getStructuringElement
      • dilate

        public static void dilate​(Mat src,
                                  Mat dst,
                                  Mat kernel,
                                  Point anchor,
                                  int iterations)
        Dilates an image by using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken: \(\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 膨張に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは #getStructuringElement を使って作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。
        iterations - 膨張を適用する回数。 SEE: erode, morphologyEx, getStructuringElement
      • dilate

        public static void dilate​(Mat src,
                                  Mat dst,
                                  Mat kernel,
                                  Point anchor)
        Dilates an image by using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken: \(\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 膨張に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは #getStructuringElement を使って作成できる。
        anchor - 要素内におけるアンカーの位置。デフォルト値 (-1, -1) はアンカーが要素の中心にあることを意味する。 SEE: erode, morphologyEx, getStructuringElement
      • dilate

        public static void dilate​(Mat src,
                                  Mat dst,
                                  Mat kernel)
        Dilates an image by using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken: \(\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')\) The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよいが、ビット深度はCV_8U, CV_16U, CV_16S, CV_32F, CV_64Fのいずれかでなければならない。
        dst - src と同じサイズおよび型の出力画像。
        kernel - 膨張に使用する構造化要素。element=Mat() の場合は 3 x 3 の矩形構造化要素が使用される。カーネルは #getStructuringElement を使って作成できる。アンカーは要素の中心にある。 SEE: erode, morphologyEx, getStructuringElement
      • morphologyEx

        public static void morphologyEx​(Mat src,
                                        Mat dst,
                                        int op,
                                        Mat kernel,
                                        Point anchor,
                                        int iterations,
                                        int borderType,
                                        Scalar borderValue)
        Performs advanced morphological transformations. The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations. Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよい。ビット深度は CV_8U, CV_16U, CV_16S, CV_32F, CV_64F のいずれかでなければならない。
        dst - 入力画像と同じサイズおよび型の出力画像。
        op - モルフォロジー演算の種類。#MorphTypes を参照。
        kernel - 構造化要素。#getStructuringElement を使って作成できる。
        anchor - カーネル内のアンカー位置。負の値はアンカーがカーネルの中心にあることを意味する。
        iterations - 収縮と膨張を適用する回数。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。
        borderValue - 境界が定数の場合の境界値。デフォルト値には特別な意味がある。 SEE: dilate, erode, getStructuringElement 覚え書き: 反復回数とは、収縮または膨張の演算が適用される回数である。たとえば、反復回数を2としたオープニング演算 (#MORPH_OPEN) は、erode -> erode -> dilate -> dilate を順に適用するのと等価である(erode -> dilate -> erode -> dilate ではない)。
      • morphologyEx

        public static void morphologyEx​(Mat src,
                                        Mat dst,
                                        int op,
                                        Mat kernel,
                                        Point anchor,
                                        int iterations,
                                        int borderType)
        Performs advanced morphological transformations. The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations. Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよい。ビット深度は CV_8U, CV_16U, CV_16S, CV_32F, CV_64F のいずれかでなければならない。
        dst - 入力画像と同じサイズおよび型の出力画像。
        op - モルフォロジー演算の種類。#MorphTypes を参照。
        kernel - 構造化要素。#getStructuringElement を使って作成できる。
        anchor - カーネル内のアンカー位置。負の値はアンカーがカーネルの中心にあることを意味する。
        iterations - 収縮と膨張を適用する回数。
        borderType - ピクセルの外挿方法。#BorderTypes を参照。#BORDER_WRAP はサポートされていない。 meaning. SEE: dilate, erode, getStructuringElement 覚え書き: 反復回数とは、収縮または膨張の演算が適用される回数である。たとえば、反復回数を2としたオープニング演算 (#MORPH_OPEN) は、erode -> erode -> dilate -> dilate を順に適用するのと等価である(erode -> dilate -> erode -> dilate ではない)。
      • morphologyEx

        public static void morphologyEx​(Mat src,
                                        Mat dst,
                                        int op,
                                        Mat kernel,
                                        Point anchor,
                                        int iterations)
        Performs advanced morphological transformations. The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations. Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよい。ビット深度は CV_8U, CV_16U, CV_16S, CV_32F, CV_64F のいずれかでなければならない。
        dst - 入力画像と同じサイズおよび型の出力画像。
        op - モルフォロジー演算の種類。#MorphTypes を参照。
        kernel - 構造化要素。#getStructuringElement を使って作成できる。
        anchor - カーネル内のアンカー位置。負の値はアンカーがカーネルの中心にあることを意味する。
        iterations - 収縮と膨張を適用する回数。 meaning. SEE: dilate, erode, getStructuringElement 覚え書き: 反復回数とは、収縮または膨張の演算が適用される回数である。たとえば、反復回数を2としたオープニング演算 (#MORPH_OPEN) は、erode -> erode -> dilate -> dilate を順に適用するのと等価である(erode -> dilate -> erode -> dilate ではない)。
      • morphologyEx

        public static void morphologyEx​(Mat src,
                                        Mat dst,
                                        int op,
                                        Mat kernel,
                                        Point anchor)
        Performs advanced morphological transformations. The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations. Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよい。ビット深度は CV_8U, CV_16U, CV_16S, CV_32F, CV_64F のいずれかでなければならない。
        dst - 入力画像と同じサイズおよび型の出力画像。
        op - モルフォロジー演算の種類。#MorphTypes を参照。
        kernel - 構造化要素。#getStructuringElement を使って作成できる。
        anchor - カーネル内のアンカー位置。負の値はアンカーがカーネルの中心にあることを意味する。 meaning. SEE: dilate, erode, getStructuringElement 覚え書き: 反復回数とは、収縮または膨張の演算が適用される回数である。たとえば、反復回数を2としたオープニング演算 (#MORPH_OPEN) は、erode -> erode -> dilate -> dilate を順に適用するのと等価である(erode -> dilate -> erode -> dilate ではない)。
      • morphologyEx

        public static void morphologyEx​(Mat src,
                                        Mat dst,
                                        int op,
                                        Mat kernel)
        Performs advanced morphological transformations. The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as basic operations. Any of the operations can be done in-place. In case of multi-channel images, each channel is processed independently.
        引数:
        src - 入力画像。チャンネル数は任意でよい。ビット深度は CV_8U, CV_16U, CV_16S, CV_32F, CV_64F のいずれかでなければならない。
        dst - 入力画像と同じサイズおよび型の出力画像。
        op - モルフォロジー演算の種類。#MorphTypes を参照。
        kernel - 構造化要素。#getStructuringElement を使って作成できる。 kernel center. meaning. SEE: dilate, erode, getStructuringElement 覚え書き: 反復回数とは、収縮または膨張の演算が適用される回数である。たとえば、反復回数を2としたオープニング演算 (#MORPH_OPEN) は、erode -> erode -> dilate -> dilate を順に適用するのと等価である(erode -> dilate -> erode -> dilate ではない)。
      • resize

        public static void resize​(Mat src,
                                  Mat dst,
                                  Size dsize,
                                  double fx,
                                  double fy,
                                  int interpolation)
        Resizes an image. The function resize resizes the image src down to or up to the specified size. Note that the initial dst type or size are not taken into account. Instead, the size and type are derived from the src,dsize,fx, and fy. If you want to resize src so that it fits the pre-created dst, you may call the function as follows: // explicitly specify dsize=dst.size(); fx and fy will be computed from that. resize(src, dst, dst.size(), 0, 0, interpolation); If you want to decimate the image by factor of 2 in each direction, you can call the function this way: // specify fx and fy and let the function compute the destination image size. resize(src, dst, Size(), 0.5, 0.5, interpolation); To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR (faster but still looks OK).
        引数:
        src - 入力画像。
        dst - 出力画像。サイズは(非ゼロのとき)dsize、もしくは src.size(), fx, fy から計算されたサイズになる。dst の型は src と同じである。
        dsize - 出力画像のサイズ。ゼロ(Python では None)の場合は次のように計算される: \(\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\) dsize、または fx と fy の両方のいずれかが非ゼロでなければならない。
        fx - 水平軸方向の拡大縮小係数。0 のときは次のように計算される \(\texttt{(double)dsize.width/src.cols}\)
        fy - 垂直軸方向の拡大縮小係数。0 のときは次のように計算される \(\texttt{(double)dsize.height/src.rows}\)
        interpolation - 補間方法。#InterpolationFlags を参照。 SEE: warpAffine, warpPerspective, remap
      • resize

        public static void resize​(Mat src,
                                  Mat dst,
                                  Size dsize,
                                  double fx,
                                  double fy)
        Resizes an image. The function resize resizes the image src down to or up to the specified size. Note that the initial dst type or size are not taken into account. Instead, the size and type are derived from the src,dsize,fx, and fy. If you want to resize src so that it fits the pre-created dst, you may call the function as follows: // explicitly specify dsize=dst.size(); fx and fy will be computed from that. resize(src, dst, dst.size(), 0, 0, interpolation); If you want to decimate the image by factor of 2 in each direction, you can call the function this way: // specify fx and fy and let the function compute the destination image size. resize(src, dst, Size(), 0.5, 0.5, interpolation); To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR (faster but still looks OK).
        引数:
        src - 入力画像。
        dst - 出力画像。サイズは(非ゼロのとき)dsize、もしくは src.size(), fx, fy から計算されたサイズになる。dst の型は src と同じである。
        dsize - 出力画像のサイズ。ゼロ(Python では None)の場合は次のように計算される: \(\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\) dsize、または fx と fy の両方のいずれかが非ゼロでなければならない。
        fx - 水平軸方向の拡大縮小係数。0 のときは次のように計算される \(\texttt{(double)dsize.width/src.cols}\)
        fy - 垂直軸方向の拡大縮小係数。0 のときは次のように計算される \(\texttt{(double)dsize.height/src.rows}\) SEE: warpAffine, warpPerspective, remap
      • resize

        public static void resize​(Mat src,
                                  Mat dst,
                                  Size dsize,
                                  double fx)
        Resizes an image. The function resize resizes the image src down to or up to the specified size. Note that the initial dst type or size are not taken into account. Instead, the size and type are derived from the src,dsize,fx, and fy. If you want to resize src so that it fits the pre-created dst, you may call the function as follows: // explicitly specify dsize=dst.size(); fx and fy will be computed from that. resize(src, dst, dst.size(), 0, 0, interpolation); If you want to decimate the image by factor of 2 in each direction, you can call the function this way: // specify fx and fy and let the function compute the destination image size. resize(src, dst, Size(), 0.5, 0.5, interpolation); To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR (faster but still looks OK).
        引数:
        src - 入力画像。
        dst - 出力画像。サイズは(非ゼロのとき)dsize、もしくは src.size(), fx, fy から計算されたサイズになる。dst の型は src と同じである。
        dsize - 出力画像のサイズ。ゼロ(Python では None)の場合は次のように計算される: \(\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\) dsize、または fx と fy の両方のいずれかが非ゼロでなければならない。
        fx - 水平軸方向の拡大縮小係数。0 のときは次のように計算される \(\texttt{(double)dsize.width/src.cols}\) \(\texttt{(double)dsize.height/src.rows}\) SEE: warpAffine, warpPerspective, remap
      • resize

        public static void resize​(Mat src,
                                  Mat dst,
                                  Size dsize)
        Resizes an image. The function resize resizes the image src down to or up to the specified size. Note that the initial dst type or size are not taken into account. Instead, the size and type are derived from the src,dsize,fx, and fy. If you want to resize src so that it fits the pre-created dst, you may call the function as follows: // explicitly specify dsize=dst.size(); fx and fy will be computed from that. resize(src, dst, dst.size(), 0, 0, interpolation); If you want to decimate the image by factor of 2 in each direction, you can call the function this way: // specify fx and fy and let the function compute the destination image size. resize(src, dst, Size(), 0.5, 0.5, interpolation); To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to enlarge an image, it will generally look best with #INTER_CUBIC (slow) or #INTER_LINEAR (faster but still looks OK).
        引数:
        src - 入力画像。
        dst - 出力画像。サイズは(非ゼロのとき)dsize、もしくは src.size(), fx, fy から計算されたサイズになる。dst の型は src と同じである。
        dsize - 出力画像のサイズ。ゼロ(Python では None)の場合は次のように計算される: \(\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}\) dsize、または fx と fy の両方のいずれかが非ゼロでなければならない。 \(\texttt{(double)dsize.width/src.cols}\) \(\texttt{(double)dsize.height/src.rows}\) SEE: warpAffine, warpPerspective, remap
      • warpAffine

        public static void warpAffine​(Mat src,
                                      Mat dst,
                                      Mat M,
                                      Size dsize,
                                      int flags,
                                      int borderMode,
                                      Scalar borderValue)
        Applies an affine transformation to an image. The function warpAffine transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with #invertAffineTransform and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(2\times 3\) の変換行列。
        dsize - 出力画像のサイズ。
        flags - 補間方法(#InterpolationFlags を参照)と、M を逆変換 ( \(\texttt{dst}\rightarrow\texttt{src}\) ) とすることを意味する省略可能なフラグ #WARP_INVERSE_MAP の組み合わせ。
        borderMode - ピクセルの外挿方法(#BorderTypes を参照)。borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。
        borderValue - 境界が定数の場合に使用される値。デフォルトでは 0 である。 SEE: warpPerspective, resize, remap, getRectSubPix, transform
      • warpAffine

        public static void warpAffine​(Mat src,
                                      Mat dst,
                                      Mat M,
                                      Size dsize,
                                      int flags,
                                      int borderMode)
        Applies an affine transformation to an image. The function warpAffine transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with #invertAffineTransform and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(2\times 3\) の変換行列。
        dsize - 出力画像のサイズ。
        flags - 補間方法(#InterpolationFlags を参照)と、M を逆変換 ( \(\texttt{dst}\rightarrow\texttt{src}\) ) とすることを意味する省略可能なフラグ #WARP_INVERSE_MAP の組み合わせ。
        borderMode - ピクセルの外挿方法(#BorderTypes を参照)。borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。 SEE: warpPerspective, resize, remap, getRectSubPix, transform
      • warpAffine

        public static void warpAffine​(Mat src,
                                      Mat dst,
                                      Mat M,
                                      Size dsize,
                                      int flags)
        Applies an affine transformation to an image. The function warpAffine transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with #invertAffineTransform and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(2\times 3\) の変換行列。
        dsize - 出力画像のサイズ。
        flags - 補間方法(#InterpolationFlags を参照)と、M を逆変換 ( \(\texttt{dst}\rightarrow\texttt{src}\) ) とすることを意味する省略可能なフラグ #WARP_INVERSE_MAP の組み合わせ。 borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。 SEE: warpPerspective, resize, remap, getRectSubPix, transform
      • warpAffine

        public static void warpAffine​(Mat src,
                                      Mat dst,
                                      Mat M,
                                      Size dsize)
        Applies an affine transformation to an image. The function warpAffine transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with #invertAffineTransform and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(2\times 3\) の変換行列。
        dsize - 出力画像のサイズ。 flag #WARP_INVERSE_MAP that means that M is the inverse transformation ( \(\texttt{dst}\rightarrow\texttt{src}\) ). borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。 SEE: warpPerspective, resize, remap, getRectSubPix, transform
      • warpPerspective

        public static void warpPerspective​(Mat src,
                                           Mat dst,
                                           Mat M,
                                           Size dsize,
                                           int flags,
                                           int borderMode,
                                           Scalar borderValue)
        Applies a perspective transformation to an image. The function warpPerspective transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} , \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(3\times 3\) の変換行列。
        dsize - 出力画像のサイズ。
        flags - 補間方法(#INTER_LINEAR または #INTER_NEAREST)と、M を逆変換 ( \(\texttt{dst}\rightarrow\texttt{src}\) ) として設定する省略可能なフラグ #WARP_INVERSE_MAP の組み合わせ。
        borderMode - ピクセルの外挿方法(#BORDER_CONSTANT または #BORDER_REPLICATE)。
        borderValue - 境界が定数の場合に使用される値。デフォルトでは 0 に等しい。 SEE: warpAffine, resize, remap, getRectSubPix, perspectiveTransform
      • warpPerspective

        public static void warpPerspective​(Mat src,
                                           Mat dst,
                                           Mat M,
                                           Size dsize,
                                           int flags,
                                           int borderMode)
        Applies a perspective transformation to an image. The function warpPerspective transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} , \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(3\times 3\) の変換行列。
        dsize - 出力画像のサイズ。
        flags - 補間方法(#INTER_LINEAR または #INTER_NEAREST)と、M を逆変換 ( \(\texttt{dst}\rightarrow\texttt{src}\) ) として設定する省略可能なフラグ #WARP_INVERSE_MAP の組み合わせ。
        borderMode - ピクセルの外挿方法(#BORDER_CONSTANT または #BORDER_REPLICATE)。 SEE: warpAffine, resize, remap, getRectSubPix, perspectiveTransform
      • warpPerspective

        public static void warpPerspective​(Mat src,
                                           Mat dst,
                                           Mat M,
                                           Size dsize,
                                           int flags)
        Applies a perspective transformation to an image. The function warpPerspective transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} , \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(3\times 3\) の変換行列。
        dsize - 出力画像のサイズ。
        flags - 補間方法(#INTER_LINEAR または #INTER_NEAREST)と、M を逆変換 ( \(\texttt{dst}\rightarrow\texttt{src}\) ) として設定する省略可能なフラグ #WARP_INVERSE_MAP の組み合わせ。 SEE: warpAffine, resize, remap, getRectSubPix, perspectiveTransform
      • warpPerspective

        public static void warpPerspective​(Mat src,
                                           Mat dst,
                                           Mat M,
                                           Size dsize)
        Applies a perspective transformation to an image. The function warpPerspective transforms the source image using the specified matrix: \(\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} , \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )\) when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert and then put in the formula above instead of M. The function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - サイズが dsize で、src と同じ型を持つ出力画像。
        M - \(3\times 3\) の変換行列。
        dsize - 出力画像のサイズ。 optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation ( \(\texttt{dst}\rightarrow\texttt{src}\) ). SEE: warpAffine, resize, remap, getRectSubPix, perspectiveTransform
      • remap

        public static void remap​(Mat src,
                                 Mat dst,
                                 Mat map1,
                                 Mat map2,
                                 int interpolation,
                                 int borderMode,
                                 Scalar borderValue)
        Applies a generic geometrical transformation to an image. The function remap transforms the source image using the specified map: \(\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))\) with the WARP_RELATIVE_MAP flag : \(\texttt{dst} (x,y) = \texttt{src} (x+map_x(x,y),y+map_y(x,y))\) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. \(map_x\) and \(map_y\) can be encoded as separate floating-point maps in \(map_1\) and \(map_2\) respectively, or interleaved floating-point maps of \((x,y)\) in \(map_1\), or fixed-point maps created by using #convertMaps. The reason you might want to convert from floating to fixed-point representations of a map is that they can yield much faster (\~2x) remapping operations. In the converted case, \(map_1\) contains pairs (cvFloor(x), cvFloor(y)) and \(map_2\) contains indices in a table of interpolation coefficients. This function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - 出力画像。map1 と同じサイズで、src と同じ型を持つ。
        map1 - (x,y) 点の最初のマップ、または x 値のみの最初のマップ。型は CV_16SC2, CV_32FC1, CV_32FC2 のいずれか。浮動小数点表現を高速化のため固定小数点表現へ変換する詳細については #convertMaps を参照。
        map2 - y 値の2番目のマップ。型はそれぞれ CV_16UC1, CV_32FC1、または none(map1 が (x,y) 点の場合は空のマップ)。
        interpolation - 補間方法(#InterpolationFlags を参照)。この関数では #INTER_AREA #INTER_LINEAR_EXACT #INTER_NEAREST_EXACT の各方法はサポートされていない。追加のフラグ WARP_RELATIVE_MAP を補間方法と OR で結合できる(例: INTER_LINEAR | WARP_RELATIVE_MAP)。
        borderMode - ピクセルの外挿方法(#BorderTypes を参照)。borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。
        borderValue - 境界が定数の場合に使用される値。デフォルトでは 0 である。 覚え書き: 現在の実装上の制限により、入力画像と出力画像のサイズは 32767x32767 未満でなければならない。
      • remap

        public static void remap​(Mat src,
                                 Mat dst,
                                 Mat map1,
                                 Mat map2,
                                 int interpolation,
                                 int borderMode)
        Applies a generic geometrical transformation to an image. The function remap transforms the source image using the specified map: \(\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))\) with the WARP_RELATIVE_MAP flag : \(\texttt{dst} (x,y) = \texttt{src} (x+map_x(x,y),y+map_y(x,y))\) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. \(map_x\) and \(map_y\) can be encoded as separate floating-point maps in \(map_1\) and \(map_2\) respectively, or interleaved floating-point maps of \((x,y)\) in \(map_1\), or fixed-point maps created by using #convertMaps. The reason you might want to convert from floating to fixed-point representations of a map is that they can yield much faster (\~2x) remapping operations. In the converted case, \(map_1\) contains pairs (cvFloor(x), cvFloor(y)) and \(map_2\) contains indices in a table of interpolation coefficients. This function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - 出力画像。map1 と同じサイズで、src と同じ型を持つ。
        map1 - (x,y) 点の最初のマップ、または x 値のみの最初のマップ。型は CV_16SC2, CV_32FC1, CV_32FC2 のいずれか。浮動小数点表現を高速化のため固定小数点表現へ変換する詳細については #convertMaps を参照。
        map2 - y 値の2番目のマップ。型はそれぞれ CV_16UC1, CV_32FC1、または none(map1 が (x,y) 点の場合は空のマップ)。
        interpolation - 補間方法(#InterpolationFlags を参照)。この関数では #INTER_AREA #INTER_LINEAR_EXACT #INTER_NEAREST_EXACT の各方法はサポートされていない。追加のフラグ WARP_RELATIVE_MAP を補間方法と OR で結合できる(例: INTER_LINEAR | WARP_RELATIVE_MAP)。
        borderMode - ピクセルの外挿方法(#BorderTypes を参照)。borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。 覚え書き: 現在の実装上の制限により、入力画像と出力画像のサイズは 32767x32767 未満でなければならない。
      • remap

        public static void remap​(Mat src,
                                 Mat dst,
                                 Mat map1,
                                 Mat map2,
                                 int interpolation)
        Applies a generic geometrical transformation to an image. The function remap transforms the source image using the specified map: \(\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))\) with the WARP_RELATIVE_MAP flag : \(\texttt{dst} (x,y) = \texttt{src} (x+map_x(x,y),y+map_y(x,y))\) where values of pixels with non-integer coordinates are computed using one of available interpolation methods. \(map_x\) and \(map_y\) can be encoded as separate floating-point maps in \(map_1\) and \(map_2\) respectively, or interleaved floating-point maps of \((x,y)\) in \(map_1\), or fixed-point maps created by using #convertMaps. The reason you might want to convert from floating to fixed-point representations of a map is that they can yield much faster (\~2x) remapping operations. In the converted case, \(map_1\) contains pairs (cvFloor(x), cvFloor(y)) and \(map_2\) contains indices in a table of interpolation coefficients. This function cannot operate in-place.
        引数:
        src - 入力画像。
        dst - 出力画像。map1 と同じサイズで、src と同じ型を持つ。
        map1 - (x,y) 点の最初のマップ、または x 値のみの最初のマップ。型は CV_16SC2, CV_32FC1, CV_32FC2 のいずれか。浮動小数点表現を高速化のため固定小数点表現へ変換する詳細については #convertMaps を参照。
        map2 - y 値の2番目のマップ。型はそれぞれ CV_16UC1, CV_32FC1、または none(map1 が (x,y) 点の場合は空のマップ)。
        interpolation - 補間方法(#InterpolationFlags を参照)。この関数では #INTER_AREA #INTER_LINEAR_EXACT #INTER_NEAREST_EXACT の各方法はサポートされていない。追加のフラグ WARP_RELATIVE_MAP を補間方法と OR で結合できる(例: INTER_LINEAR | WARP_RELATIVE_MAP)。 borderMode=#BORDER_TRANSPARENT の場合、入力画像の「外れ値」に対応する出力画像のピクセルが関数によって変更されないことを意味する。 覚え書き: 現在の実装上の制限により、入力画像と出力画像のサイズは 32767x32767 未満でなければならない。
      • convertMaps

        public static void convertMaps​(Mat map1,
                                       Mat map2,
                                       Mat dstmap1,
                                       Mat dstmap2,
                                       int dstmap1type,
                                       boolean nninterpolation)
        Converts image transformation maps from one representation to another. The function converts a pair of maps for remap from one representation to another. The following options ( (map1.type(), map2.type()) \(\rightarrow\) (dstmap1.type(), dstmap2.type()) ) are supported:
        • \(\texttt{(CV_32FC1, CV_32FC1)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}\)。これは最も頻繁に使用される変換操作で、元の浮動小数点マップ(#remap を参照)を、よりコンパクトで高速な固定小数点表現へ変換する。最初の出力配列には丸められた座標が格納され、2番目の配列(nninterpolation=false のときのみ作成される)には補間テーブル内のインデックスが格納される。
        • \(\texttt{(CV_32FC2)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}\)。上と同じだが、元のマップが1つの2チャンネル行列に格納されている。
        • 逆変換。当然ながら、再構成された浮動小数点マップは元のものと完全に同一にはならない。
        引数:
        map1 - 型が CV_16SC2, CV_32FC1, CV_32FC2 のいずれかである最初の入力マップ。
        map2 - 型がそれぞれ CV_16UC1, CV_32FC1、または none(空の行列)である2番目の入力マップ。
        dstmap1 - 型が dstmap1type で、src と同じサイズを持つ最初の出力マップ。
        dstmap2 - 2番目の出力マップ。
        dstmap1type - 最初の出力マップの型。CV_16SC2, CV_32FC1, CV_32FC2 のいずれかでなければならない。
        nninterpolation - 固定小数点マップを最近傍補間に使うか、より複雑な補間に使うかを示すフラグ。 SEE: remap, undistort, initUndistortRectifyMap
      • convertMaps

        public static void convertMaps​(Mat map1,
                                       Mat map2,
                                       Mat dstmap1,
                                       Mat dstmap2,
                                       int dstmap1type)
        Converts image transformation maps from one representation to another. The function converts a pair of maps for remap from one representation to another. The following options ( (map1.type(), map2.type()) \(\rightarrow\) (dstmap1.type(), dstmap2.type()) ) are supported:
        • \(\texttt{(CV_32FC1, CV_32FC1)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}\)。これは最も頻繁に使用される変換操作で、元の浮動小数点マップ(#remap を参照)を、よりコンパクトで高速な固定小数点表現へ変換する。最初の出力配列には丸められた座標が格納され、2番目の配列(nninterpolation=false のときのみ作成される)には補間テーブル内のインデックスが格納される。
        • \(\texttt{(CV_32FC2)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}\)。上と同じだが、元のマップが1つの2チャンネル行列に格納されている。
        • 逆変換。当然ながら、再構成された浮動小数点マップは元のものと完全に同一にはならない。
        引数:
        map1 - 型が CV_16SC2, CV_32FC1, CV_32FC2 のいずれかである最初の入力マップ。
        map2 - 型がそれぞれ CV_16UC1, CV_32FC1、または none(空の行列)である2番目の入力マップ。
        dstmap1 - 型が dstmap1type で、src と同じサイズを持つ最初の出力マップ。
        dstmap2 - 2番目の出力マップ。
        dstmap1type - 最初の出力マップの型。CV_16SC2, CV_32FC1, CV_32FC2 のいずれかでなければならない。 nearest-neighbor or for a more complex interpolation. SEE: remap, undistort, initUndistortRectifyMap
      • getRotationMatrix2D

        public static Mat getRotationMatrix2D​(Point center,
                                              double angle,
                                              double scale)
        Calculates an affine matrix of 2D rotation. The function calculates the following matrix: \(\begin{bmatrix} \alpha & \beta & (1- \alpha ) \cdot \texttt{center.x} - \beta \cdot \texttt{center.y} \\ - \beta & \alpha & \beta \cdot \texttt{center.x} + (1- \alpha ) \cdot \texttt{center.y} \end{bmatrix}\) where \(\begin{array}{l} \alpha = \texttt{scale} \cdot \cos \texttt{angle} , \\ \beta = \texttt{scale} \cdot \sin \texttt{angle} \end{array}\) The transformation maps the rotation center to itself. If this is not the target, adjust the shift.
        引数:
        center - 入力画像における回転の中心。
        angle - 回転角度(度)。正の値は反時計回りの回転を意味する(座標原点は左上隅にあると仮定する)。
        scale - 等方的な拡大縮小係数。 SEE: getAffineTransform, warpAffine, transform
        戻り値:
        自動生成
      • invertAffineTransform

        public static void invertAffineTransform​(Mat M,
                                                 Mat iM)
        Inverts an affine transformation. The function computes an inverse affine transformation represented by \(2 \times 3\) matrix M: \(\begin{bmatrix} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \end{bmatrix}\) The result is also a \(2 \times 3\) matrix of the same type as M.
        引数:
        M - 元のアフィン変換。
        iM - 出力される逆アフィン変換。
      • getPerspectiveTransform

        public static Mat getPerspectiveTransform​(Mat src,
                                                  Mat dst,
                                                  int solveMethod)
        Calculates a perspective transform from four pairs of the corresponding points. The function calculates the \(3 \times 3\) matrix of a perspective transform so that: \(\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\) where \(dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\)
        引数:
        src - 入力画像における四角形の頂点の座標。
        dst - 出力画像における対応する四辺形の頂点の座標。
        solveMethod - cv::solve に渡される手法 (#DecompTypes) SEE: findHomography, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • getPerspectiveTransform

        public static Mat getPerspectiveTransform​(Mat src,
                                                  Mat dst)
        Calculates a perspective transform from four pairs of the corresponding points. The function calculates the \(3 \times 3\) matrix of a perspective transform so that: \(\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}\) where \(dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3\)
        引数:
        src - 入力画像における四角形の頂点の座標。
        dst - 出力画像における対応する四辺形の頂点の座標。 SEE: findHomography, warpPerspective, perspectiveTransform
        戻り値:
        自動生成
      • getRectSubPix

        public static void getRectSubPix​(Mat image,
                                         Size patchSize,
                                         Point center,
                                         Mat patch,
                                         int patchType)
        Retrieves a pixel rectangle from an image with sub-pixel accuracy. The function getRectSubPix extracts pixels from src: \(patch(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)\) where the values of the pixels at non-integer coordinates are retrieved using bilinear interpolation. Every channel of multi-channel images is processed independently. Also the image should be a single channel or three channel image. While the center of the rectangle must be inside the image, parts of the rectangle may be outside.
        引数:
        image - 入力画像。
        patchSize - 抽出するパッチのサイズ。
        center - 入力画像内で抽出する矩形の中心の浮動小数点座標。中心は画像内になければならない。
        patch - 抽出されたパッチ。サイズは patchSize で、src と同じチャンネル数を持つ。
        patchType - 抽出されるピクセルのビット深度。デフォルトでは src と同じビット深度を持つ。 SEE: warpAffine, warpPerspective
      • getRectSubPix

        public static void getRectSubPix​(Mat image,
                                         Size patchSize,
                                         Point center,
                                         Mat patch)
        Retrieves a pixel rectangle from an image with sub-pixel accuracy. The function getRectSubPix extracts pixels from src: \(patch(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)\) where the values of the pixels at non-integer coordinates are retrieved using bilinear interpolation. Every channel of multi-channel images is processed independently. Also the image should be a single channel or three channel image. While the center of the rectangle must be inside the image, parts of the rectangle may be outside.
        引数:
        image - 入力画像。
        patchSize - 抽出するパッチのサイズ。
        center - 入力画像内で抽出する矩形の中心の浮動小数点座標。中心は画像内になければならない。
        patch - 抽出されたパッチ。サイズは patchSize で、src と同じチャンネル数を持つ。 SEE: warpAffine, warpPerspective
      • logPolar

        @Deprecated
        public static void logPolar​(Mat src,
                                    Mat dst,
                                    Point center,
                                    double M,
                                    int flags)
        Deprecated.
        This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags+WARP_POLAR_LOG); Transform the source image using the following transformation (See REF: polar_remaps_reference_image "Polar remaps reference image d)"): \(\begin{array}{l} dst( \rho , \phi ) = src(x,y) \\ dst.size() \leftarrow src.size() \end{array}\) where \(\begin{array}{l} I = (dx,dy) = (x - center.x,y - center.y) \\ \rho = M \cdot log_e(\texttt{magnitude} (I)) ,\\ \phi = Kangle \cdot \texttt{angle} (I) \\ \end{array}\) and \(\begin{array}{l} M = src.cols / log_e(maxRadius) \\ Kangle = src.rows / 2\Pi \\ \end{array}\) The function emulates the human "foveal" vision and can be used for fast scale and rotation-invariant template matching, for object tracking and so forth.
        Remaps an image to semilog-polar coordinates space.
        引数:
        src - 入力画像
        dst - 出力画像。src と同じサイズおよび型を持つ。
        center - 変換の中心。出力の精度が最大になる点。
        M - 倍率スケールパラメータ。変換対象となる境界円の半径を決定する。
        flags - A combination of interpolation methods, see #InterpolationFlags 覚え書き:
        • この関数はインプレースでは動作できない。
        • 大きさと角度(度)の計算には内部で #cartToPolar を使用するため、角度は 0 から 360 まで約 0.3 度の精度で測定される。
        SEE: cv::linearPolar
      • linearPolar

        @Deprecated
        public static void linearPolar​(Mat src,
                                       Mat dst,
                                       Point center,
                                       double maxRadius,
                                       int flags)
        Deprecated.
        This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags) Transform the source image using the following transformation (See REF: polar_remaps_reference_image "Polar remaps reference image c)"): \(\begin{array}{l} dst( \rho , \phi ) = src(x,y) \\ dst.size() \leftarrow src.size() \end{array}\) where \(\begin{array}{l} I = (dx,dy) = (x - center.x,y - center.y) \\ \rho = Kmag \cdot \texttt{magnitude} (I) ,\\ \phi = angle \cdot \texttt{angle} (I) \end{array}\) and \(\begin{array}{l} Kx = src.cols / maxRadius \\ Ky = src.rows / 2\Pi \end{array}\)
        Remaps an image to polar coordinates space.
        引数:
        src - 入力画像
        dst - 出力画像。src と同じサイズおよび型を持つ。
        center - 変換の中心。
        maxRadius - 変換対象となる境界円の半径。逆倍率スケールパラメータも決定する。
        flags - A combination of interpolation methods, see #InterpolationFlags 覚え書き:
        • この関数はインプレースでは動作できない。
        • 大きさと角度(度)の計算には内部で #cartToPolar を使用するため、角度は 0 から 360 まで約 0.3 度の精度で測定される。
        SEE: cv::logPolar
      • warpPolar

        public static void warpPolar​(Mat src,
                                     Mat dst,
                                     Size dsize,
                                     Point center,
                                     double maxRadius,
                                     int flags)
        Remaps an image to polar or semilog-polar coordinates space polar_remaps_reference_image ![Polar remaps reference](pics/polar_remap_doc.png) Transform the source image using the following transformation: \( dst(\rho , \phi ) = src(x,y) \) where \( \begin{array}{l} \vec{I} = (x - center.x, \;y - center.y) \\ \phi = Kangle \cdot \texttt{angle} (\vec{I}) \\ \rho = \left\{\begin{matrix} Klin \cdot \texttt{magnitude} (\vec{I}) & default \\ Klog \cdot log_e(\texttt{magnitude} (\vec{I})) & if \; semilog \\ \end{matrix}\right. \end{array} \) and \( \begin{array}{l} Kangle = dsize.height / 2\Pi \\ Klin = dsize.width / maxRadius \\ Klog = dsize.width / log_e(maxRadius) \\ \end{array} \) \par Linear vs semilog mapping Polar mapping can be linear or semi-log. Add one of #WarpPolarMode to flags to specify the polar mapping mode. Linear is the default mode. The semilog mapping emulates the human "foveal" vision that permit very high acuity on the line of sight (central vision) in contrast to peripheral vision where acuity is minor. \par Option on dsize:
        • dsize &lt;=0 の両方の値が(デフォルトで)成り立つ場合、出力画像は入力の境界円とほぼ同じ面積を持つ: \(\begin{array}{l} dsize.area \leftarrow (maxRadius^2 \cdot \Pi) \\ dsize.width = \texttt{cvRound}(maxRadius) \\ dsize.height = \texttt{cvRound}(maxRadius \cdot \Pi) \\ \end{array}\)
        • dsize.height &lt;= 0 のみが成り立つ場合、出力画像の面積は境界円の面積に比例するが、Kx * Kx でスケーリングされる: \(\begin{array}{l} dsize.height = \texttt{cvRound}(dsize.width \cdot \Pi) \\ \end{array} \)
        • dsize &gt; 0 の両方の値が成り立つ場合、出力画像は指定されたサイズを持ち、したがって境界円の面積は dsize にスケーリングされる。
        \par Reverse mapping You can get reverse mapping adding #WARP_INVERSE_MAP to flags \snippet polar_transforms.cpp InverseMap In addiction, to calculate the original coordinate from a polar mapped coordinate \((rho, phi)->(x, y)\): \snippet polar_transforms.cpp InverseCoordinate
        引数:
        src - 入力画像。
        dst - 出力画像。src と同じ型を持つ。
        dsize - 出力画像のサイズ(有効なオプションについては説明を参照)。
        center - 変換の中心。
        maxRadius - 変換対象となる境界円の半径。逆倍率スケールパラメータも決定する。
        flags - A combination of interpolation methods, #InterpolationFlags + #WarpPolarMode.
        • 線形極座標マッピングを選択するには #WARP_POLAR_LINEAR を加える(デフォルト)
        • 片対数極座標マッピングを選択するには #WARP_POLAR_LOG を加える
        • 逆マッピングには #WARP_INVERSE_MAP を加える。
        覚え書き:
        • この関数はインプレースでは動作できない。
        • 大きさと角度(度)の計算には内部で #cartToPolar を使用するため、角度は 0 から 360 まで約 0.3 度の精度で測定される。
        • この関数は #remap を使用する。現在の実装上の制約により、入力画像および出力画像のサイズは 32767x32767 未満でなければならない。
        SEE: cv::remap
      • integral3

        public static void integral3​(Mat src,
                                     Mat sum,
                                     Mat sqsum,
                                     Mat tilted,
                                     int sdepth,
                                     int sqdepth)
        Calculates the integral of an image. The function calculates one or more integral images for the source image as follows: \(\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)\) \(\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2\) \(\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)\) Using these integral images, you can calculate sum, mean, and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example: \(\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)\) It makes possible to do a fast blurring or fast block correlation with a variable window size, for example. In case of multi-channel images, sums for each channel are accumulated independently. As a practical example, the next figure shows the calculation of the integral of a straight rectangle Rect(4,4,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the original image are shown, as well as the relative pixels in the integral images sum and tilted . ![integral calculation example](pics/integral.png)
        引数:
        src - 入力画像。\(W \times H\)、8ビットまたは浮動小数点(32f または 64f)。
        sum - 積分画像。\((W+1)\times (H+1)\)、32ビット整数または浮動小数点(32f または 64f)。
        sqsum - ピクセル値の2乗の積分画像。\((W+1)\times (H+1)\) の倍精度浮動小数点(64f)配列。
        tilted - 45度回転した画像の積分。\((W+1)\times (H+1)\) 配列で、sum と同じデータ型を持つ。
        sdepth - 積分画像および傾斜積分画像の希望するビット深度。CV_32S、CV_32F、または CV_64F。
        sqdepth - ピクセル値の2乗の積分画像の希望するビット深度。CV_32F または CV_64F。
      • integral3

        public static void integral3​(Mat src,
                                     Mat sum,
                                     Mat sqsum,
                                     Mat tilted,
                                     int sdepth)
        Calculates the integral of an image. The function calculates one or more integral images for the source image as follows: \(\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)\) \(\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2\) \(\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)\) Using these integral images, you can calculate sum, mean, and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example: \(\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)\) It makes possible to do a fast blurring or fast block correlation with a variable window size, for example. In case of multi-channel images, sums for each channel are accumulated independently. As a practical example, the next figure shows the calculation of the integral of a straight rectangle Rect(4,4,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the original image are shown, as well as the relative pixels in the integral images sum and tilted . ![integral calculation example](pics/integral.png)
        引数:
        src - 入力画像。\(W \times H\)、8ビットまたは浮動小数点(32f または 64f)。
        sum - 積分画像。\((W+1)\times (H+1)\)、32ビット整数または浮動小数点(32f または 64f)。
        sqsum - ピクセル値の2乗の積分画像。\((W+1)\times (H+1)\) の倍精度浮動小数点(64f)配列。
        tilted - 45度回転した画像の積分。\((W+1)\times (H+1)\) 配列で、sum と同じデータ型を持つ。
        sdepth - 積分画像および傾斜積分画像の希望するビット深度。CV_32S、CV_32F、または CV_64F。
      • integral3

        public static void integral3​(Mat src,
                                     Mat sum,
                                     Mat sqsum,
                                     Mat tilted)
        Calculates the integral of an image. The function calculates one or more integral images for the source image as follows: \(\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)\) \(\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2\) \(\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)\) Using these integral images, you can calculate sum, mean, and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example: \(\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)\) It makes possible to do a fast blurring or fast block correlation with a variable window size, for example. In case of multi-channel images, sums for each channel are accumulated independently. As a practical example, the next figure shows the calculation of the integral of a straight rectangle Rect(4,4,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the original image are shown, as well as the relative pixels in the integral images sum and tilted . ![integral calculation example](pics/integral.png)
        引数:
        src - 入力画像。\(W \times H\)、8ビットまたは浮動小数点(32f または 64f)。
        sum - 積分画像。\((W+1)\times (H+1)\)、32ビット整数または浮動小数点(32f または 64f)。
        sqsum - ピクセル値の2乗の積分画像。\((W+1)\times (H+1)\) の倍精度浮動小数点(64f)配列。
        tilted - 45度回転した画像の積分。\((W+1)\times (H+1)\) 配列で、sum と同じデータ型を持つ。CV_64F。
      • integral

        public static void integral​(Mat src,
                                    Mat sum,
                                    int sdepth)
      • integral

        public static void integral​(Mat src,
                                    Mat sum)
      • integral2

        public static void integral2​(Mat src,
                                     Mat sum,
                                     Mat sqsum,
                                     int sdepth,
                                     int sqdepth)
      • integral2

        public static void integral2​(Mat src,
                                     Mat sum,
                                     Mat sqsum,
                                     int sdepth)
      • integral2

        public static void integral2​(Mat src,
                                     Mat sum,
                                     Mat sqsum)
      • accumulate

        public static void accumulate​(Mat src,
                                      Mat dst,
                                      Mat mask)
        Adds an image to the accumulator image. The function adds src or some of its elements to dst : \(\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) The function supports multi-channel images. Each channel is processed independently. The function cv::accumulate can be used, for example, to collect statistics of a scene background viewed by a still camera and for the further foreground-background segmentation.
        引数:
        src - 入力画像。型は CV_8UC(n)、CV_16UC(n)、CV_32FC(n) または CV_64FC(n)。n は正の整数。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、ビット深度は CV_32F または CV_64F。
        mask - 省略可能な操作マスク。 SEE: accumulateSquare, accumulateProduct, accumulateWeighted
      • accumulate

        public static void accumulate​(Mat src,
                                      Mat dst)
        Adds an image to the accumulator image. The function adds src or some of its elements to dst : \(\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) The function supports multi-channel images. Each channel is processed independently. The function cv::accumulate can be used, for example, to collect statistics of a scene background viewed by a still camera and for the further foreground-background segmentation.
        引数:
        src - 入力画像。型は CV_8UC(n)、CV_16UC(n)、CV_32FC(n) または CV_64FC(n)。n は正の整数。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、ビット深度は CV_32F または CV_64F。 SEE: accumulateSquare, accumulateProduct, accumulateWeighted
      • accumulateSquare

        public static void accumulateSquare​(Mat src,
                                            Mat dst,
                                            Mat mask)
        Adds the square of a source image to the accumulator image. The function adds the input image src or its selected region, raised to a power of 2, to the accumulator dst : \(\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y)^2 \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) The function supports multi-channel images. Each channel is processed independently.
        引数:
        src - 入力画像。1チャンネルまたは3チャンネル、8ビットまたは32ビット浮動小数点。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、32ビットまたは64ビット浮動小数点。
        mask - 省略可能な操作マスク。 SEE: accumulateSquare, accumulateProduct, accumulateWeighted
      • accumulateSquare

        public static void accumulateSquare​(Mat src,
                                            Mat dst)
        Adds the square of a source image to the accumulator image. The function adds the input image src or its selected region, raised to a power of 2, to the accumulator dst : \(\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y)^2 \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) The function supports multi-channel images. Each channel is processed independently.
        引数:
        src - 入力画像。1チャンネルまたは3チャンネル、8ビットまたは32ビット浮動小数点。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、32ビットまたは64ビット浮動小数点。 SEE: accumulateSquare, accumulateProduct, accumulateWeighted
      • accumulateProduct

        public static void accumulateProduct​(Mat src1,
                                             Mat src2,
                                             Mat dst,
                                             Mat mask)
        Adds the per-element product of two input images to the accumulator image. The function adds the product of two images or their selected regions to the accumulator dst : \(\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src1} (x,y) \cdot \texttt{src2} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) The function supports multi-channel images. Each channel is processed independently.
        引数:
        src1 - 第1入力画像。1チャンネルまたは3チャンネル、8ビットまたは32ビット浮動小数点。
        src2 - src1 と同じ型かつ同じサイズの第2入力画像。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、32ビットまたは64ビット浮動小数点。
        mask - 省略可能な操作マスク。 SEE: accumulate, accumulateSquare, accumulateWeighted
      • accumulateProduct

        public static void accumulateProduct​(Mat src1,
                                             Mat src2,
                                             Mat dst)
        Adds the per-element product of two input images to the accumulator image. The function adds the product of two images or their selected regions to the accumulator dst : \(\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src1} (x,y) \cdot \texttt{src2} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) The function supports multi-channel images. Each channel is processed independently.
        引数:
        src1 - 第1入力画像。1チャンネルまたは3チャンネル、8ビットまたは32ビット浮動小数点。
        src2 - src1 と同じ型かつ同じサイズの第2入力画像。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、32ビットまたは64ビット浮動小数点。 SEE: accumulate, accumulateSquare, accumulateWeighted
      • accumulateWeighted

        public static void accumulateWeighted​(Mat src,
                                              Mat dst,
                                              double alpha,
                                              Mat mask)
        Updates a running average. The function calculates the weighted sum of the input image src and the accumulator dst so that dst becomes a running average of a frame sequence: \(\texttt{dst} (x,y) \leftarrow (1- \texttt{alpha} ) \cdot \texttt{dst} (x,y) + \texttt{alpha} \cdot \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) That is, alpha regulates the update speed (how fast the accumulator "forgets" about earlier images). The function supports multi-channel images. Each channel is processed independently.
        引数:
        src - 入力画像。1チャンネルまたは3チャンネル、8ビットまたは32ビット浮動小数点。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、32ビットまたは64ビット浮動小数点。
        alpha - 入力画像の重み。
        mask - 省略可能な操作マスク。 SEE: accumulate, accumulateSquare, accumulateProduct
      • accumulateWeighted

        public static void accumulateWeighted​(Mat src,
                                              Mat dst,
                                              double alpha)
        Updates a running average. The function calculates the weighted sum of the input image src and the accumulator dst so that dst becomes a running average of a frame sequence: \(\texttt{dst} (x,y) \leftarrow (1- \texttt{alpha} ) \cdot \texttt{dst} (x,y) + \texttt{alpha} \cdot \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0\) That is, alpha regulates the update speed (how fast the accumulator "forgets" about earlier images). The function supports multi-channel images. Each channel is processed independently.
        引数:
        src - 入力画像。1チャンネルまたは3チャンネル、8ビットまたは32ビット浮動小数点。
        dst - %Accumulator 画像。入力画像と同じチャンネル数を持ち、32ビットまたは64ビット浮動小数点。
        alpha - 入力画像の重み。 SEE: accumulate, accumulateSquare, accumulateProduct
      • phaseCorrelate

        public static Point phaseCorrelate​(Mat src1,
                                           Mat src2,
                                           Mat window,
                                           double[] response)
        The function is used to detect translational shifts that occur between two images. The operation takes advantage of the Fourier shift theorem for detecting the translational shift in the frequency domain. It can be used for fast image registration as well as motion estimation. For more information please see <https://en.wikipedia.org/wiki/Phase_correlation> Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed with getOptimalDFTSize. The function performs the following equations:
        • まず、ユーザーから指定されている場合は、各画像に Hanning 窓を適用してエッジ効果の可能性を除去する。REF: createHanningWindow および <https://en.wikipedia.org/wiki/Hann_function> を参照。この窓は処理時間を短縮するため、配列サイズが変わるまでキャッシュされることがある。
        • 次に、各入力配列の順方向DFTを計算する: \(\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}\) ここで \(\mathcal{F}\) は順方向DFTである。
        • 続いて、各周波数領域配列のクロスパワースペクトルを計算する: \(R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}\)
        • 次に、相互相関を逆DFTにより時間領域へ戻す: \(r = \mathcal{F}^{-1}\{R\}\)
        • 最後に、ピーク位置を計算し、サブピクセル精度を実現するためにピーク周辺の5x5の重み付き重心を計算する。 \((\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}\)
        • 非ゼロの場合、response 引数はピーク位置周辺の5x5重心内における r の要素の総和として計算される。これは最大値1に正規化され(1は単一のピークが存在することを意味する)、複数のピークが存在する場合はより小さくなる。
        引数:
        src1 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        src2 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        window - エッジ効果を低減するための窓関数係数を持つ浮動小数点配列(省略可能)。
        response - ピーク周辺の5x5重心内の信号パワー。0から1の間(省略可能)。
        戻り値:
        2つの配列間で検出された位相シフト(サブピクセル)。 SEE: dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow
      • phaseCorrelate

        public static Point phaseCorrelate​(Mat src1,
                                           Mat src2,
                                           Mat window)
        The function is used to detect translational shifts that occur between two images. The operation takes advantage of the Fourier shift theorem for detecting the translational shift in the frequency domain. It can be used for fast image registration as well as motion estimation. For more information please see <https://en.wikipedia.org/wiki/Phase_correlation> Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed with getOptimalDFTSize. The function performs the following equations:
        • まず、ユーザーから指定されている場合は、各画像に Hanning 窓を適用してエッジ効果の可能性を除去する。REF: createHanningWindow および <https://en.wikipedia.org/wiki/Hann_function> を参照。この窓は処理時間を短縮するため、配列サイズが変わるまでキャッシュされることがある。
        • 次に、各入力配列の順方向DFTを計算する: \(\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}\) ここで \(\mathcal{F}\) は順方向DFTである。
        • 続いて、各周波数領域配列のクロスパワースペクトルを計算する: \(R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}\)
        • 次に、相互相関を逆DFTにより時間領域へ戻す: \(r = \mathcal{F}^{-1}\{R\}\)
        • 最後に、ピーク位置を計算し、サブピクセル精度を実現するためにピーク周辺の5x5の重み付き重心を計算する。 \((\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}\)
        • 非ゼロの場合、response 引数はピーク位置周辺の5x5重心内における r の要素の総和として計算される。これは最大値1に正規化され(1は単一のピークが存在することを意味する)、複数のピークが存在する場合はより小さくなる。
        引数:
        src1 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        src2 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        window - エッジ効果を低減するための窓関数係数を持つ浮動小数点配列(省略可能)。
        戻り値:
        2つの配列間で検出された位相シフト(サブピクセル)。 SEE: dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow
      • phaseCorrelate

        public static Point phaseCorrelate​(Mat src1,
                                           Mat src2)
        The function is used to detect translational shifts that occur between two images. The operation takes advantage of the Fourier shift theorem for detecting the translational shift in the frequency domain. It can be used for fast image registration as well as motion estimation. For more information please see <https://en.wikipedia.org/wiki/Phase_correlation> Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed with getOptimalDFTSize. The function performs the following equations:
        • まず、ユーザーから指定されている場合は、各画像に Hanning 窓を適用してエッジ効果の可能性を除去する。REF: createHanningWindow および <https://en.wikipedia.org/wiki/Hann_function> を参照。この窓は処理時間を短縮するため、配列サイズが変わるまでキャッシュされることがある。
        • 次に、各入力配列の順方向DFTを計算する: \(\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}\) ここで \(\mathcal{F}\) は順方向DFTである。
        • 続いて、各周波数領域配列のクロスパワースペクトルを計算する: \(R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}\)
        • 次に、相互相関を逆DFTにより時間領域へ戻す: \(r = \mathcal{F}^{-1}\{R\}\)
        • 最後に、ピーク位置を計算し、サブピクセル精度を実現するためにピーク周辺の5x5の重み付き重心を計算する。 \((\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}\)
        • 非ゼロの場合、response 引数はピーク位置周辺の5x5重心内における r の要素の総和として計算される。これは最大値1に正規化され(1は単一のピークが存在することを意味する)、複数のピークが存在する場合はより小さくなる。
        引数:
        src1 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        src2 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        戻り値:
        2つの配列間で検出された位相シフト(サブピクセル)。 SEE: dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow
      • phaseCorrelateIterative

        public static Point phaseCorrelateIterative​(Mat src1,
                                                    Mat src2,
                                                    int L2size,
                                                    int maxIters)
        Detects translational shifts between two images. This function extends the standard REF: phaseCorrelate method by improving sub-pixel accuracy through iterative shift refinement in the phase-correlation space, as described in CITE: hrazdira2020iterative.
        引数:
        src1 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        src2 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        L2size - 反復的なシフト精緻化アルゴリズムで使用される相関近傍のサイズ。
        maxIters - 反復的な精緻化アルゴリズムが実行する最大反復回数。
        戻り値:
        2つの配列間で検出されたサブピクセルシフト。 SEE: phaseCorrelate, dft, idft, createHanningWindow
      • phaseCorrelateIterative

        public static Point phaseCorrelateIterative​(Mat src1,
                                                    Mat src2,
                                                    int L2size)
        Detects translational shifts between two images. This function extends the standard REF: phaseCorrelate method by improving sub-pixel accuracy through iterative shift refinement in the phase-correlation space, as described in CITE: hrazdira2020iterative.
        引数:
        src1 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        src2 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        L2size - 反復的なシフト精緻化アルゴリズムで使用される相関近傍のサイズ。
        戻り値:
        2つの配列間で検出されたサブピクセルシフト。 SEE: phaseCorrelate, dft, idft, createHanningWindow
      • phaseCorrelateIterative

        public static Point phaseCorrelateIterative​(Mat src1,
                                                    Mat src2)
        Detects translational shifts between two images. This function extends the standard REF: phaseCorrelate method by improving sub-pixel accuracy through iterative shift refinement in the phase-correlation space, as described in CITE: hrazdira2020iterative.
        引数:
        src1 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        src2 - 入力浮動小数点配列(CV_32FC1 または CV_64FC1)
        戻り値:
        2つの配列間で検出されたサブピクセルシフト。 SEE: phaseCorrelate, dft, idft, createHanningWindow
      • createHanningWindow

        public static void createHanningWindow​(Mat dst,
                                               Size winSize,
                                               int type)
        This function computes a Hanning window coefficients in two dimensions. See (https://en.wikipedia.org/wiki/Hann_function) and (https://en.wikipedia.org/wiki/Window_function) for more information. An example is shown below: // create hanning window of size 100x100 and type CV_32F Mat hann; createHanningWindow(hann, Size(100, 100), CV_32F);
        引数:
        dst - Hann 係数を格納する出力配列
        winSize - 窓サイズの指定(幅と高さの両方が > 1 でなければならない)
        type - 作成する配列の型
      • divSpectrums

        public static void divSpectrums​(Mat a,
                                        Mat b,
                                        Mat c,
                                        int flags,
                                        boolean conjB)
        Performs the per-element division of the first Fourier spectrum by the second Fourier spectrum. The function cv::divSpectrums performs the per-element division of the first array by the second array. The arrays are CCS-packed or complex matrices that are results of a real or complex Fourier transform.
        引数:
        a - 第1の入力配列。
        b - src1 と同じサイズおよび型の第2の入力配列。
        c - src1 と同じサイズおよび型の出力配列。
        flags - 演算フラグ。現在サポートされている唯一のフラグは cv::DFT_ROWS であり、これは src1 と src2 の各行が独立した1次元フーリエスペクトルであることを示す。このフラグを使用しない場合は、単に値として 0 を指定する。
        conjB - 乗算の前に第2の入力配列を共役にするか(true)しないか(false)を指定する省略可能なフラグ。
      • divSpectrums

        public static void divSpectrums​(Mat a,
                                        Mat b,
                                        Mat c,
                                        int flags)
        Performs the per-element division of the first Fourier spectrum by the second Fourier spectrum. The function cv::divSpectrums performs the per-element division of the first array by the second array. The arrays are CCS-packed or complex matrices that are results of a real or complex Fourier transform.
        引数:
        a - 第1の入力配列。
        b - src1 と同じサイズおよび型の第2の入力配列。
        c - src1 と同じサイズおよび型の出力配列。
        flags - 演算フラグ。現在サポートされている唯一のフラグは cv::DFT_ROWS であり、これは src1 と src2 の各行が独立した1次元フーリエスペクトルであることを示す。このフラグを使用しない場合は、単に値として 0 を指定する。 しないか(false)。
      • threshold

        public static double threshold​(Mat src,
                                       Mat dst,
                                       double thresh,
                                       double maxval,
                                       int type)
        Applies a fixed-level threshold to each array element. The function applies fixed-level thresholding to a multiple-channel array. The function is typically used to get a bi-level (binary) image out of a grayscale image ( #compare could be also used for this purpose) or for removing a noise, that is, filtering out pixels with too small or too large values. There are several types of thresholding supported by the function. They are determined by type parameter. Also, the special values #THRESH_OTSU or #THRESH_TRIANGLE may be combined with one of the above values. In these cases, the function determines the optimal threshold value using the Otsu's or Triangle algorithm and uses it instead of the specified thresh. 覚え書き: Currently, the Otsu's method is implemented only for CV_8UC1 and CV_16UC1 images, and the Triangle's method is implemented only for CV_8UC1 images.
        引数:
        src - 入力配列(マルチチャンネル、CV_8U、CV_16S、CV_16U、CV_32F または CV_64F)。
        dst - src と同じサイズ・同じ型・同じチャンネル数の出力配列。
        thresh - しきい値。
        maxval - #THRESH_BINARY および #THRESH_BINARY_INV のしきい値処理タイプで使用する最大値。
        type - しきい値処理のタイプ(#ThresholdTypes を参照)。
        戻り値:
        Otsu法または三角法を用いた場合は計算されたしきい値を返す。 SEE: thresholdWithMask, adaptiveThreshold, findContours, compare, min, max
      • thresholdWithMask

        public static double thresholdWithMask​(Mat src,
                                               Mat dst,
                                               Mat mask,
                                               double thresh,
                                               double maxval,
                                               int type)
        Same as #threshold, but with an optional mask 覚え書き: If the mask is empty, #thresholdWithMask is equivalent to #threshold. If the mask is not empty, dst *must* be of the same size and type as src, so that outliers pixels are left as-is
        引数:
        src - 入力配列(マルチチャンネル、8ビットまたは32ビット浮動小数点)。
        dst - src と同じサイズ・同じ型・同じチャンネル数の出力配列。
        mask - 省略可能なマスク(src と同じサイズ、8ビット)。
        thresh - しきい値。
        maxval - #THRESH_BINARY および #THRESH_BINARY_INV のしきい値処理タイプで使用する最大値。
        type - しきい値処理のタイプ(#ThresholdTypes を参照)。
        戻り値:
        Otsu法または三角法を用いた場合は計算されたしきい値を返す。 SEE: threshold, adaptiveThreshold, findContours, compare, min, max
      • adaptiveThreshold

        public static void adaptiveThreshold​(Mat src,
                                             Mat dst,
                                             double maxValue,
                                             int adaptiveMethod,
                                             int thresholdType,
                                             int blockSize,
                                             double C)
        Applies an adaptive threshold to an array. The function transforms a grayscale image to a binary image according to the formulae:
        • THRESH_BINARY \(dst(x,y) = \fork{\texttt{maxValue}}{if \(src(x,y) > T(x,y)\)}{0}{otherwise}\)
        • THRESH_BINARY_INV \(dst(x,y) = \fork{0}{if \(src(x,y) > T(x,y)\)}{\texttt{maxValue}}{otherwise}\) ここで \(T(x,y)\) は各ピクセルごとに個別に計算されるしきい値である(adaptiveMethod 引数を参照)。
        The function can process the image in-place.
        引数:
        src - 入力の8ビットシングルチャンネル画像。
        dst - src と同じサイズ・同じ型の出力画像。
        maxValue - 条件を満たすピクセルに割り当てる非ゼロの値
        adaptiveMethod - 使用する適応的しきい値処理アルゴリズム(#AdaptiveThresholdTypes を参照)。境界の処理には #BORDER_REPLICATE | #BORDER_ISOLATED が用いられる。
        thresholdType - しきい値処理のタイプで、#THRESH_BINARY または #THRESH_BINARY_INV のいずれかでなければならない(#ThresholdTypes を参照)。
        blockSize - ピクセルのしきい値を計算するために用いるピクセル近傍のサイズ:3, 5, 7 など。
        C - 平均または加重平均から差し引く定数(詳細は下記参照)。通常は正の値だが、ゼロや負の値でもよい。 SEE: threshold, blur, GaussianBlur
      • pyrDown

        public static void pyrDown​(Mat src,
                                   Mat dst,
                                   Size dstsize,
                                   int borderType)
        Blurs an image and downsamples it. By default, size of the output image is computed as Size((src.cols+1)/2, (src.rows+1)/2), but in any case, the following conditions should be satisfied: \(\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}\) The function performs the downsampling step of the Gaussian pyramid construction. First, it convolves the source image with the kernel: \(\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}\) Then, it downsamples the image by rejecting even rows and columns.
        引数:
        src - 入力画像。
        dst - 出力画像。指定されたサイズを持ち、src と同じ型である。
        dstsize - 出力画像のサイズ。
        borderType - ピクセルの外挿方法(#BorderTypes を参照、#BORDER_CONSTANT はサポートされていない)
      • pyrDown

        public static void pyrDown​(Mat src,
                                   Mat dst,
                                   Size dstsize)
        Blurs an image and downsamples it. By default, size of the output image is computed as Size((src.cols+1)/2, (src.rows+1)/2), but in any case, the following conditions should be satisfied: \(\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}\) The function performs the downsampling step of the Gaussian pyramid construction. First, it convolves the source image with the kernel: \(\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}\) Then, it downsamples the image by rejecting even rows and columns.
        引数:
        src - 入力画像。
        dst - 出力画像。指定されたサイズを持ち、src と同じ型である。
        dstsize - 出力画像のサイズ。
      • pyrDown

        public static void pyrDown​(Mat src,
                                   Mat dst)
        Blurs an image and downsamples it. By default, size of the output image is computed as Size((src.cols+1)/2, (src.rows+1)/2), but in any case, the following conditions should be satisfied: \(\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}\) The function performs the downsampling step of the Gaussian pyramid construction. First, it convolves the source image with the kernel: \(\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}\) Then, it downsamples the image by rejecting even rows and columns.
        引数:
        src - 入力画像。
        dst - 出力画像。指定されたサイズを持ち、src と同じ型である。
      • pyrUp

        public static void pyrUp​(Mat src,
                                 Mat dst,
                                 Size dstsize,
                                 int borderType)
        Upsamples an image and then blurs it. By default, size of the output image is computed as Size(src.cols\*2, (src.rows\*2), but in any case, the following conditions should be satisfied: \(\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}\) The function performs the upsampling step of the Gaussian pyramid construction, though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in pyrDown multiplied by 4.
        引数:
        src - 入力画像。
        dst - 出力画像。指定されたサイズを持ち、src と同じ型である。
        dstsize - 出力画像のサイズ。
        borderType - ピクセルの外挿方法(#BorderTypes を参照、#BORDER_DEFAULT のみサポートされている)
      • pyrUp

        public static void pyrUp​(Mat src,
                                 Mat dst,
                                 Size dstsize)
        Upsamples an image and then blurs it. By default, size of the output image is computed as Size(src.cols\*2, (src.rows\*2), but in any case, the following conditions should be satisfied: \(\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}\) The function performs the upsampling step of the Gaussian pyramid construction, though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in pyrDown multiplied by 4.
        引数:
        src - 入力画像。
        dst - 出力画像。指定されたサイズを持ち、src と同じ型である。
        dstsize - 出力画像のサイズ。
      • pyrUp

        public static void pyrUp​(Mat src,
                                 Mat dst)
        Upsamples an image and then blurs it. By default, size of the output image is computed as Size(src.cols\*2, (src.rows\*2), but in any case, the following conditions should be satisfied: \(\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}\) The function performs the upsampling step of the Gaussian pyramid construction, though it can actually be used to construct the Laplacian pyramid. First, it upsamples the source image by injecting even zero rows and columns and then convolves the result with the same kernel as in pyrDown multiplied by 4.
        引数:
        src - 入力画像。
        dst - 出力画像。指定されたサイズを持ち、src と同じ型である。
      • calcHist

        public static void calcHist​(java.util.List<Mat> images,
                                    MatOfInt channels,
                                    Mat mask,
                                    Mat hist,
                                    MatOfInt histSize,
                                    MatOfFloat ranges,
                                    boolean accumulate)
        this variant supports only uniform histograms. ranges argument is either empty vector or a flattened vector of histSize.size()*2 elements (histSize.size() element pairs). The first and second elements of each pair specify the lower and upper boundaries.
        引数:
        images - 自動生成
        channels - 自動生成
        mask - 自動生成
        hist - 自動生成
        histSize - 自動生成
        ranges - 自動生成
        accumulate - 自動生成
      • calcHist

        public static void calcHist​(java.util.List<Mat> images,
                                    MatOfInt channels,
                                    Mat mask,
                                    Mat hist,
                                    MatOfInt histSize,
                                    MatOfFloat ranges)
        this variant supports only uniform histograms. ranges argument is either empty vector or a flattened vector of histSize.size()*2 elements (histSize.size() element pairs). The first and second elements of each pair specify the lower and upper boundaries.
        引数:
        images - 自動生成
        channels - 自動生成
        mask - 自動生成
        hist - 自動生成
        histSize - 自動生成
        ranges - 自動生成
      • calcBackProject

        public static void calcBackProject​(java.util.List<Mat> images,
                                           MatOfInt channels,
                                           Mat hist,
                                           Mat dst,
                                           MatOfFloat ranges,
                                           double scale)
      • compareHist

        public static double compareHist​(Mat H1,
                                         Mat H2,
                                         int method)
        Compares two histograms. The function cv::compareHist compares two dense or two sparse histograms using the specified method. The function returns \(d(H_1, H_2)\) . While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms or more general sparse configurations of weighted points, consider using the #EMD function.
        引数:
        H1 - 比較する1つ目のヒストグラム。
        H2 - H1 と同じサイズの比較する2つ目のヒストグラム。
        method - 比較方法(#HistCompMethods を参照)
        戻り値:
        自動生成
      • equalizeHist

        public static void equalizeHist​(Mat src,
                                        Mat dst)
        Equalizes the histogram of a grayscale image. The function equalizes the histogram of the input image using the following algorithm:
        • src に対するヒストグラム \(H\) を計算する。
        • ヒストグラムのビンの総和が255になるようにヒストグラムを正規化する。
        • ヒストグラムの積分を計算する: \(H'_i = \sum _{0 \le j < i} H(j)\)
        • \(H'\) をルックアップテーブルとして用いて画像を変換する: \(\texttt{dst}(x,y) = H'(\texttt{src}(x,y))\)
        The algorithm normalizes the brightness and increases the contrast of the image.
        引数:
        src - 入力の8ビットシングルチャンネル画像。
        dst - src と同じサイズおよび型の出力画像。
      • createCLAHE

        public static CLAHE createCLAHE​(double clipLimit,
                                        Size tileGridSize)
        Creates a smart pointer to a cv::CLAHE class and initializes it.
        引数:
        clipLimit - コントラスト制限のためのしきい値。
        tileGridSize - ヒストグラム平坦化のためのグリッドのサイズ。入力画像は等しいサイズの矩形タイルに分割される。tileGridSize は行方向と列方向のタイル数を定義する。
        戻り値:
        自動生成
      • createCLAHE

        public static CLAHE createCLAHE​(double clipLimit)
        Creates a smart pointer to a cv::CLAHE class and initializes it.
        引数:
        clipLimit - コントラスト制限のためのしきい値。等しいサイズの矩形タイル。tileGridSize は行方向と列方向のタイル数を定義する。
        戻り値:
        自動生成
      • createCLAHE

        public static CLAHE createCLAHE()
        Creates a smart pointer to a cv::CLAHE class and initializes it. equally sized rectangular tiles. tileGridSize defines the number of tiles in row and column.
        戻り値:
        自動生成
      • EMD

        public static float EMD​(Mat signature1,
                                Mat signature2,
                                int distType,
                                Mat cost,
                                Mat flow)
        Computes the "minimal work" distance between two weighted point configurations. The function computes the earth mover distance and/or a lower boundary of the distance between the two weighted point configurations. One of the applications described in CITE: RubnerSept98, CITE: Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation problem that is solved using some modification of a simplex algorithm, thus the complexity is exponential in the worst case, though, on average it is much faster. In the case of a real metric the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used to determine roughly whether the two signatures are far enough so that they cannot relate to the same object.
        引数:
        signature1 - 1つ目のシグネチャ。\(\texttt{size1}\times \texttt{dims}+1\) の浮動小数点行列。各行には点の重みに続いて点の座標が格納される。ユーザー定義のコスト行列を使用する場合は、行列が単一の列(重みのみ)を持つことが許される。重みは非負でなければならず、少なくとも1つは非ゼロの値でなければならない。
        signature2 - signature1 と同じ形式の2つ目のシグネチャ。ただし行数は異なってもよい。合計の重みも異なってよい。その場合、signature1 または signature2 のいずれかに余分な「ダミー」の点が追加される。重みは非負でなければならず、少なくとも1つは非ゼロの値でなければならない。
        distType - 使用する距離尺度。#DistanceTypes を参照。
        cost - ユーザー定義の \(\texttt{size1}\times \texttt{size2}\) コスト行列。なお、コスト行列を使用する場合は距離尺度関数が必要となるため、下限 lowerBound を計算できない。これはシグネチャ間の距離であり、質量中心間の距離である。ユーザー定義のコスト行列を使用する場合、点配置の合計の重みが等しくない場合、またはシグネチャが重みのみで構成される場合(シグネチャ行列が単一の列を持つ場合)は、下限を計算できないことがある。\*lowerBound は必ず初期化しなければならない。計算された質量中心間の距離が \*lowerBound 以上である場合(これはシグネチャが十分に離れていることを意味する)、関数は EMD を計算しない。いずれの場合も、戻り時に \*lowerBound には計算された質量中心間の距離が設定される。したがって、質量中心間の距離と EMD の両方を計算したい場合は、\*lowerBound を 0 に設定するべきである。
        flow - 結果として得られる \(\texttt{size1} \times \texttt{size2}\) のフロー行列。\(\texttt{flow}_{i,j}\) は signature1 の \(i\) 番目の点から signature2 の \(j\) 番目の点へのフローである。
        戻り値:
        自動生成
      • EMD

        public static float EMD​(Mat signature1,
                                Mat signature2,
                                int distType,
                                Mat cost)
        Computes the "minimal work" distance between two weighted point configurations. The function computes the earth mover distance and/or a lower boundary of the distance between the two weighted point configurations. One of the applications described in CITE: RubnerSept98, CITE: Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation problem that is solved using some modification of a simplex algorithm, thus the complexity is exponential in the worst case, though, on average it is much faster. In the case of a real metric the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used to determine roughly whether the two signatures are far enough so that they cannot relate to the same object.
        引数:
        signature1 - 1つ目のシグネチャ。\(\texttt{size1}\times \texttt{dims}+1\) の浮動小数点行列。各行には点の重みに続いて点の座標が格納される。ユーザー定義のコスト行列を使用する場合は、行列が単一の列(重みのみ)を持つことが許される。重みは非負でなければならず、少なくとも1つは非ゼロの値でなければならない。
        signature2 - signature1 と同じ形式の2つ目のシグネチャ。ただし行数は異なってもよい。合計の重みも異なってよい。その場合、signature1 または signature2 のいずれかに余分な「ダミー」の点が追加される。重みは非負でなければならず、少なくとも1つは非ゼロの値でなければならない。
        distType - 使用する距離尺度。#DistanceTypes を参照。
        cost - ユーザー定義の \(\texttt{size1}\times \texttt{size2}\) コスト行列。なお、コスト行列を使用する場合は距離尺度関数が必要となるため、下限 lowerBound を計算できない。これはシグネチャ間の距離であり、質量中心間の距離である。ユーザー定義のコスト行列を使用する場合、点配置の合計の重みが等しくない場合、またはシグネチャが重みのみで構成される場合(シグネチャ行列が単一の列を持つ場合)は、下限を計算できないことがある。\*lowerBound は必ず初期化しなければならない。計算された質量中心間の距離が \*lowerBound 以上である場合(これはシグネチャが十分に離れていることを意味する)、関数は EMD を計算しない。いずれの場合も、戻り時に \*lowerBound には計算された質量中心間の距離が設定される。したがって、質量中心間の距離と EMD の両方を計算したい場合は、\*lowerBound を 0 に設定するべきである。 signature1 の \(i\) 番目の点から signature2 の \(j\) 番目の点へのフロー。
        戻り値:
        自動生成
      • EMD

        public static float EMD​(Mat signature1,
                                Mat signature2,
                                int distType)
        Computes the "minimal work" distance between two weighted point configurations. The function computes the earth mover distance and/or a lower boundary of the distance between the two weighted point configurations. One of the applications described in CITE: RubnerSept98, CITE: Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation problem that is solved using some modification of a simplex algorithm, thus the complexity is exponential in the worst case, though, on average it is much faster. In the case of a real metric the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used to determine roughly whether the two signatures are far enough so that they cannot relate to the same object.
        引数:
        signature1 - 1つ目のシグネチャ。\(\texttt{size1}\times \texttt{dims}+1\) の浮動小数点行列。各行には点の重みに続いて点の座標が格納される。ユーザー定義のコスト行列を使用する場合は、行列が単一の列(重みのみ)を持つことが許される。重みは非負でなければならず、少なくとも1つは非ゼロの値でなければならない。
        signature2 - signature1 と同じ形式の2つ目のシグネチャ。ただし行数は異なってもよい。合計の重みも異なってよい。その場合、signature1 または signature2 のいずれかに余分な「ダミー」の点が追加される。重みは非負でなければならず、少なくとも1つは非ゼロの値でなければならない。
        distType - 使用する距離尺度。#DistanceTypes を参照。 を使用する場合、距離尺度関数が必要となるため下限 lowerBound を計算できない。これはシグネチャ間の距離であり、質量中心間の距離である。ユーザー定義のコスト行列を使用する場合、点配置の合計の重みが等しくない場合、またはシグネチャが重みのみで構成される場合(シグネチャ行列が単一の列を持つ場合)は、下限を計算できないことがある。\*lowerBound は必ず初期化しなければならない。計算された質量中心間の距離が \*lowerBound 以上である場合(これはシグネチャが十分に離れていることを意味する)、関数は EMD を計算しない。いずれの場合も、戻り時に \*lowerBound には計算された質量中心間の距離が設定される。したがって、質量中心間の距離と EMD の両方を計算したい場合は、\*lowerBound を 0 に設定するべきである。 signature1 の \(i\) 番目の点から signature2 の \(j\) 番目の点へのフロー。
        戻り値:
        自動生成
      • watershed

        public static void watershed​(Mat image,
                                     Mat markers)
        Performs a marker-based image segmentation using the watershed algorithm. The function implements one of the variants of watershed, non-parametric marker-based segmentation algorithm, described in CITE: Meyer92 . Before passing the image to the function, you have to roughly outline the desired regions in the image markers with positive (>0) indices. So, every region is represented as one or more connected components with the pixel values 1, 2, 3, and so on. Such markers can be retrieved from a binary mask using #findContours and #drawContours (see the watershed.cpp demo). The markers are "seeds" of the future image regions. All the other pixels in markers , whose relation to the outlined regions is not known and should be defined by the algorithm, should be set to 0's. In the function output, each pixel in markers is set to a value of the "seed" components or to -1 at boundaries between the regions. 覚え書き: Any two neighbor connected components are not necessarily separated by a watershed boundary (-1's pixels); for example, they can touch each other in the initial marker image passed to the function.
        引数:
        image - 入力の8ビット3チャンネル画像。
        markers - マーカーの入出力32ビットシングルチャンネル画像(マップ)。image と同じサイズでなければならない。 SEE: findContours
      • pyrMeanShiftFiltering

        public static void pyrMeanShiftFiltering​(Mat src,
                                                 Mat dst,
                                                 double sp,
                                                 double sr,
                                                 int maxLevel,
                                                 TermCriteria termcrit)
        Performs initial step of meanshift segmentation of an image. The function implements the filtering stage of meanshift segmentation, that is, the output of the function is the filtered "posterized" image with color gradients and fine-grain texture flattened. At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is considered: \((x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}\) where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively (though, the algorithm does not depend on the color space used, so any 3-component color space can be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector (R',G',B') are found and they act as the neighborhood center on the next iteration: \((X,Y)~(X',Y'), (R,G,B)~(R',G',B').\) After the iterations over, the color components of the initial pixel (that is, the pixel from where the iterations started) are set to the final value (average color at the last iteration): \(I(X,Y) <- (R*,G*,B*)\) When maxLevel > 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is run on the smallest layer first. After that, the results are propagated to the larger layer and the iterations are run again only on those pixels where the layer colors differ by more than sr from the lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the results will be actually different from the ones obtained by running the meanshift procedure on the whole original image (i.e. when maxLevel==0).
        引数:
        src - 入力の8ビット3チャンネル画像。
        dst - 入力と同じ形式・同じサイズの出力画像。
        sp - 空間ウィンドウの半径。
        sr - 色ウィンドウの半径。
        maxLevel - セグメンテーションに用いるピラミッドの最大レベル。
        termcrit - 終了条件:meanshift の反復をいつ停止するか。
      • pyrMeanShiftFiltering

        public static void pyrMeanShiftFiltering​(Mat src,
                                                 Mat dst,
                                                 double sp,
                                                 double sr,
                                                 int maxLevel)
        Performs initial step of meanshift segmentation of an image. The function implements the filtering stage of meanshift segmentation, that is, the output of the function is the filtered "posterized" image with color gradients and fine-grain texture flattened. At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is considered: \((x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}\) where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively (though, the algorithm does not depend on the color space used, so any 3-component color space can be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector (R',G',B') are found and they act as the neighborhood center on the next iteration: \((X,Y)~(X',Y'), (R,G,B)~(R',G',B').\) After the iterations over, the color components of the initial pixel (that is, the pixel from where the iterations started) are set to the final value (average color at the last iteration): \(I(X,Y) <- (R*,G*,B*)\) When maxLevel > 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is run on the smallest layer first. After that, the results are propagated to the larger layer and the iterations are run again only on those pixels where the layer colors differ by more than sr from the lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the results will be actually different from the ones obtained by running the meanshift procedure on the whole original image (i.e. when maxLevel==0).
        引数:
        src - 入力の8ビット3チャンネル画像。
        dst - 入力と同じ形式・同じサイズの出力画像。
        sp - 空間ウィンドウの半径。
        sr - 色ウィンドウの半径。
        maxLevel - セグメンテーションに用いるピラミッドの最大レベル。
      • pyrMeanShiftFiltering

        public static void pyrMeanShiftFiltering​(Mat src,
                                                 Mat dst,
                                                 double sp,
                                                 double sr)
        Performs initial step of meanshift segmentation of an image. The function implements the filtering stage of meanshift segmentation, that is, the output of the function is the filtered "posterized" image with color gradients and fine-grain texture flattened. At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is considered: \((x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}\) where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively (though, the algorithm does not depend on the color space used, so any 3-component color space can be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector (R',G',B') are found and they act as the neighborhood center on the next iteration: \((X,Y)~(X',Y'), (R,G,B)~(R',G',B').\) After the iterations over, the color components of the initial pixel (that is, the pixel from where the iterations started) are set to the final value (average color at the last iteration): \(I(X,Y) <- (R*,G*,B*)\) When maxLevel > 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is run on the smallest layer first. After that, the results are propagated to the larger layer and the iterations are run again only on those pixels where the layer colors differ by more than sr from the lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the results will be actually different from the ones obtained by running the meanshift procedure on the whole original image (i.e. when maxLevel==0).
        引数:
        src - 入力の8ビット3チャンネル画像。
        dst - 入力と同じ形式・同じサイズの出力画像。
        sp - 空間ウィンドウの半径。
        sr - 色ウィンドウの半径。
      • grabCut

        public static void grabCut​(Mat img,
                                   Mat mask,
                                   Rect rect,
                                   Mat bgdModel,
                                   Mat fgdModel,
                                   int iterCount,
                                   int mode)
        Runs the GrabCut algorithm. The function implements the [GrabCut image segmentation algorithm](https://en.wikipedia.org/wiki/GrabCut).
        引数:
        img - 入力の8ビット3チャンネル画像。
        mask - 入出力の8ビットシングルチャンネルマスク。mode が #GC_INIT_WITH_RECT に設定されている場合、マスクは関数によって初期化される。その要素は #GrabCutClasses のいずれかの値を取りうる。
        rect - セグメンテーション対象のオブジェクトを含む ROI。ROI の外側のピクセルは「明白な背景」としてマークされる。この引数は mode==#GC_INIT_WITH_RECT のときにのみ使用される。
        bgdModel - 背景モデル用の一時配列。同じ画像を処理している間は変更しないこと。
        fgdModel - 前景モデル用の一時配列。同じ画像を処理している間は変更しないこと。
        iterCount - 結果を返す前にアルゴリズムが行う反復回数。結果は mode==#GC_INIT_WITH_MASK または mode==GC_EVAL でさらに呼び出すことで改善できることに注意。
        mode - 操作モード。#GrabCutModes のいずれかを指定できる。
      • grabCut

        public static void grabCut​(Mat img,
                                   Mat mask,
                                   Rect rect,
                                   Mat bgdModel,
                                   Mat fgdModel,
                                   int iterCount)
        Runs the GrabCut algorithm. The function implements the [GrabCut image segmentation algorithm](https://en.wikipedia.org/wiki/GrabCut).
        引数:
        img - 入力の8ビット3チャンネル画像。
        mask - 入出力の8ビットシングルチャンネルマスク。mode が #GC_INIT_WITH_RECT に設定されている場合、マスクは関数によって初期化される。その要素は #GrabCutClasses のいずれかの値を取りうる。
        rect - セグメンテーション対象のオブジェクトを含む ROI。ROI の外側のピクセルは「明白な背景」としてマークされる。この引数は mode==#GC_INIT_WITH_RECT のときにのみ使用される。
        bgdModel - 背景モデル用の一時配列。同じ画像を処理している間は変更しないこと。
        fgdModel - 前景モデル用の一時配列。同じ画像を処理している間は変更しないこと。
        iterCount - 結果を返す前にアルゴリズムが行う反復回数。結果は mode==#GC_INIT_WITH_MASK または mode==GC_EVAL でさらに呼び出すことで改善できることに注意。
      • distanceTransformWithLabels

        public static void distanceTransformWithLabels​(Mat src,
                                                       Mat dst,
                                                       Mat labels,
                                                       int distanceType,
                                                       int maskSize,
                                                       int labelType)
        Calculates the distance to the closest zero pixel for each pixel of the source image. The function cv::distanceTransform calculates the approximate or precise distance from every binary image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero. When maskSize == #DIST_MASK_PRECISE and distanceType == #DIST_L2 , the function runs the algorithm described in CITE: Felzenszwalb04 . This algorithm is parallelized with the TBB library. In other cases, the algorithm CITE: Borgefors86 is used. This means that for a pixel the function finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical, diagonal, or knight's move (the latest is available for a \(5\times 5\) mask). The overall distance is calculated as a sum of these basic distances. Since the distance function should be symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all the diagonal shifts must have the same cost (denoted as b), and all knight's moves must have the same cost (denoted as c). For the #DIST_C and #DIST_L1 types, the distance is calculated precisely, whereas for #DIST_L2 (Euclidean distance) the distance can be calculated only with a relative error (a \(5\times 5\) mask gives more accurate results). For a,b, and c, OpenCV uses the values suggested in the original paper:
        • DIST_L1: a = 1, b = 2
        • DIST_L2:
          • 3 x 3: a=0.955, b=1.3693
          • 5 x 5: a=1, b=1.4, c=2.1969
        • DIST_C: a = 1, b = 1
        Typically, for a fast, coarse distance estimation #DIST_L2, a \(3\times 3\) mask is used. For a more accurate distance estimation #DIST_L2, a \(5\times 5\) mask or the precise algorithm is used. Note that both the precise and the approximate algorithms are linear on the number of pixels. This variant of the function does not only compute the minimum distance for each pixel \((x, y)\) but also identifies the nearest connected component consisting of zero pixels (labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the component/pixel is stored in labels(x, y). When labelType==#DIST_LABEL_CCOMP, the function automatically finds connected components of zero pixels in the input image and marks them with distinct labels. When labelType==#DIST_LABEL_PIXEL, the function scans through the input image and marks all the zero pixels with distinct labels. In this mode, the complexity is still linear. That is, the function provides a very fast way to compute the Voronoi diagram for a binary image. Currently, the second variant can use only the approximate distance transform algorithm, i.e. maskSize=#DIST_MASK_PRECISE is not supported yet.
        引数:
        src - 8ビットシングルチャンネル(2値)の入力画像。
        dst - 計算された距離を格納する出力画像。src と同じサイズの8ビットまたは32ビット浮動小数点シングルチャンネル画像である。
        labels - ラベルの出力2次元配列(離散ボロノイ図)。型は CV_32SC1 で、src と同じサイズを持つ。
        distanceType - 距離の種類。#DistanceTypes を参照。
        maskSize - 距離変換マスクのサイズ。#DistanceTransformMasks を参照。このバリアントでは #DIST_MASK_PRECISE はサポートされていない。#DIST_L1 または #DIST_C の距離タイプの場合、\(3\times 3\) のマスクは \(5\times 5\) やそれ以上の大きさの開口部と同じ結果を与えるため、この引数は強制的に 3 となる。
        labelType - 構築するラベル配列の種類。#DistanceTransformLabelTypes を参照。
      • distanceTransformWithLabels

        public static void distanceTransformWithLabels​(Mat src,
                                                       Mat dst,
                                                       Mat labels,
                                                       int distanceType,
                                                       int maskSize)
        Calculates the distance to the closest zero pixel for each pixel of the source image. The function cv::distanceTransform calculates the approximate or precise distance from every binary image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero. When maskSize == #DIST_MASK_PRECISE and distanceType == #DIST_L2 , the function runs the algorithm described in CITE: Felzenszwalb04 . This algorithm is parallelized with the TBB library. In other cases, the algorithm CITE: Borgefors86 is used. This means that for a pixel the function finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical, diagonal, or knight's move (the latest is available for a \(5\times 5\) mask). The overall distance is calculated as a sum of these basic distances. Since the distance function should be symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all the diagonal shifts must have the same cost (denoted as b), and all knight's moves must have the same cost (denoted as c). For the #DIST_C and #DIST_L1 types, the distance is calculated precisely, whereas for #DIST_L2 (Euclidean distance) the distance can be calculated only with a relative error (a \(5\times 5\) mask gives more accurate results). For a,b, and c, OpenCV uses the values suggested in the original paper:
        • DIST_L1: a = 1, b = 2
        • DIST_L2:
          • 3 x 3: a=0.955, b=1.3693
          • 5 x 5: a=1, b=1.4, c=2.1969
        • DIST_C: a = 1, b = 1
        Typically, for a fast, coarse distance estimation #DIST_L2, a \(3\times 3\) mask is used. For a more accurate distance estimation #DIST_L2, a \(5\times 5\) mask or the precise algorithm is used. Note that both the precise and the approximate algorithms are linear on the number of pixels. This variant of the function does not only compute the minimum distance for each pixel \((x, y)\) but also identifies the nearest connected component consisting of zero pixels (labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the component/pixel is stored in labels(x, y). When labelType==#DIST_LABEL_CCOMP, the function automatically finds connected components of zero pixels in the input image and marks them with distinct labels. When labelType==#DIST_LABEL_PIXEL, the function scans through the input image and marks all the zero pixels with distinct labels. In this mode, the complexity is still linear. That is, the function provides a very fast way to compute the Voronoi diagram for a binary image. Currently, the second variant can use only the approximate distance transform algorithm, i.e. maskSize=#DIST_MASK_PRECISE is not supported yet.
        引数:
        src - 8ビットシングルチャンネル(2値)の入力画像。
        dst - 計算された距離を格納する出力画像。src と同じサイズの8ビットまたは32ビット浮動小数点シングルチャンネル画像である。
        labels - ラベルの出力2次元配列(離散ボロノイ図)。型は CV_32SC1 で、src と同じサイズを持つ。
        distanceType - 距離の種類。#DistanceTypes を参照。
        maskSize - 距離変換マスクのサイズ。#DistanceTransformMasks を参照。このバリアントでは #DIST_MASK_PRECISE はサポートされていない。#DIST_L1 または #DIST_C の距離タイプの場合、\(3\times 3\) のマスクは \(5\times 5\) やそれ以上の大きさの開口部と同じ結果を与えるため、この引数は強制的に 3 となる。
      • distanceTransform

        public static void distanceTransform​(Mat src,
                                             Mat dst,
                                             int distanceType,
                                             int maskSize,
                                             int dstType)
        引数:
        src - 8ビットシングルチャンネル(2値)の入力画像。
        dst - 計算された距離を格納する出力画像。src と同じサイズの8ビットまたは32ビット浮動小数点シングルチャンネル画像である。
        distanceType - 距離の種類。#DistanceTypes を参照。
        maskSize - 距離変換マスクのサイズ。#DistanceTransformMasks を参照。#DIST_L1 または #DIST_C の距離タイプの場合、\(3\times 3\) のマスクは \(5\times 5\) やそれ以上の大きさの開口部と同じ結果を与えるため、この引数は強制的に 3 となる。
        dstType - 出力画像の型。CV_8U または CV_32F を指定できる。CV_8U は関数の最初のバリアントかつ distanceType == #DIST_L1 の場合にのみ使用できる。
      • distanceTransform

        public static void distanceTransform​(Mat src,
                                             Mat dst,
                                             int distanceType,
                                             int maskSize)
        引数:
        src - 8ビットシングルチャンネル(2値)の入力画像。
        dst - 計算された距離を格納する出力画像。src と同じサイズの8ビットまたは32ビット浮動小数点シングルチャンネル画像である。
        distanceType - 距離の種類。#DistanceTypes を参照。
        maskSize - 距離変換マスクのサイズ。#DistanceTransformMasks を参照。距離タイプが #DIST_L1 または #DIST_C の場合、\(3\times 3\) マスクは \(5\times 5\) やそれ以上の大きさのアパーチャと同じ結果を与えるため、この引数は強制的に3になる。関数の最初の変種かつ distanceType == #DIST_L1 の場合。
      • floodFill

        public static int floodFill​(Mat image,
                                    Mat mask,
                                    Point seedPoint,
                                    Scalar newVal,
                                    Rect rect,
                                    Scalar loDiff,
                                    Scalar upDiff,
                                    int flags)
        Fills a connected component with the given color. The function cv::floodFill fills a connected component starting from the seed point with the specified color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The pixel at \((x,y)\) is considered to belong to the repainted domain if:
        • グレースケール画像かつ変動範囲の場合 \(\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\)
        • グレースケール画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\)
        • カラー画像かつ変動範囲の場合 \(\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\) \(\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\)
        • カラー画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\) \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\)
        where \(src(x',y')\) is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:
        • 浮動範囲 (floating range) の場合は、すでに連結成分に属する隣接ピクセルのうちの1つの色/明るさ。
        • 固定範囲 (fixed range) の場合は、シード点の色/明るさ。
        Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on.
        引数:
        image - 入出力用の1チャンネルまたは3チャンネル、8ビットまたは浮動小数点の画像。関数の2番目の変種で #FLOODFILL_MASK_ONLY フラグが設定されていない限り、この関数によって変更される。詳細は以下を参照。
        mask - 操作用マスク。シングルチャンネルの8ビット画像で、image より幅・高さともに2ピクセル大きくなければならない。空の Mat が渡された場合は自動的に作成される。これは入力と出力の両方を兼ねる引数であるため、初期化の責任は呼び出し側にある。塗りつぶしは入力マスク内の非ゼロピクセルを越えて進むことはできない。例えば、エッジ検出器の出力をマスクとして用いることで、エッジで塗りつぶしを止めることができる。出力時には、image 内の塗りつぶされたピクセルに対応するマスク内のピクセルが、1または以下で説明する flags で指定された値に設定される。さらに、関数は内部処理を簡略化するためにマスクの境界を1で埋める。したがって、複数回の関数呼び出しで同じマスクを使用すれば、塗りつぶされた領域が重ならないようにすることができる。
        seedPoint - 開始点。
        newVal - 再描画される領域のピクセルの新しい値。
        loDiff - 現在着目しているピクセルと、その近傍のうち連結成分に属するピクセル(または成分に追加されるシードピクセル)との間で許容される最大の輝度/色の下方向の差。
        upDiff - 現在着目しているピクセルと、その近傍のうち連結成分に属するピクセル(または成分に追加されるシードピクセル)との間で許容される最大の輝度/色の上方向の差。
        rect - 省略可能な出力引数。再描画された領域の最小バウンディング矩形が関数によって設定される。
        flags - 操作フラグ。最初の8ビットには連結性の値が含まれる。デフォルト値の4は、最も近い4つの近傍ピクセル(エッジを共有するもの)のみが考慮されることを意味する。連結性の値が8の場合は、最も近い8つの近傍ピクセル(コーナーを共有するもの)が考慮される。次の8ビット(8〜16)には、マスクを埋めるための1から255の間の値が含まれる(デフォルト値は1)。例えば、4 | ( 255 << 8 ) は4近傍を考慮し、マスクを値255で埋める。以下の追加オプションはさらに上位のビットを占めるため、ビット単位の論理和(|)を用いて連結性やマスク埋め値とさらに組み合わせることができる。#FloodFillFlags を参照。覚え書き: マスクは塗りつぶし対象画像より大きいため、image 内のピクセル \((x, y)\) はマスク内のピクセル \((x+1, y+1)\) に対応する。SEE: findContours
        戻り値:
        自動生成
      • floodFill

        public static int floodFill​(Mat image,
                                    Mat mask,
                                    Point seedPoint,
                                    Scalar newVal,
                                    Rect rect,
                                    Scalar loDiff,
                                    Scalar upDiff)
        Fills a connected component with the given color. The function cv::floodFill fills a connected component starting from the seed point with the specified color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The pixel at \((x,y)\) is considered to belong to the repainted domain if:
        • グレースケール画像かつ変動範囲の場合 \(\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\)
        • グレースケール画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\)
        • カラー画像かつ変動範囲の場合 \(\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\) \(\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\)
        • カラー画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\) \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\)
        where \(src(x',y')\) is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:
        • 浮動範囲 (floating range) の場合は、すでに連結成分に属する隣接ピクセルのうちの1つの色/明るさ。
        • 固定範囲 (fixed range) の場合は、シード点の色/明るさ。
        Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on.
        引数:
        image - 入出力用の1チャンネルまたは3チャンネル、8ビットまたは浮動小数点の画像。関数の2番目の変種で #FLOODFILL_MASK_ONLY フラグが設定されていない限り、この関数によって変更される。詳細は以下を参照。
        mask - 操作用マスク。シングルチャンネルの8ビット画像で、image より幅・高さともに2ピクセル大きくなければならない。空の Mat が渡された場合は自動的に作成される。これは入力と出力の両方を兼ねる引数であるため、初期化の責任は呼び出し側にある。塗りつぶしは入力マスク内の非ゼロピクセルを越えて進むことはできない。例えば、エッジ検出器の出力をマスクとして用いることで、エッジで塗りつぶしを止めることができる。出力時には、image 内の塗りつぶされたピクセルに対応するマスク内のピクセルが、1または以下で説明する flags で指定された値に設定される。さらに、関数は内部処理を簡略化するためにマスクの境界を1で埋める。したがって、複数回の関数呼び出しで同じマスクを使用すれば、塗りつぶされた領域が重ならないようにすることができる。
        seedPoint - 開始点。
        newVal - 再描画される領域のピクセルの新しい値。
        loDiff - 現在着目しているピクセルと、その近傍のうち連結成分に属するピクセル(または成分に追加されるシードピクセル)との間で許容される最大の輝度/色の下方向の差。
        upDiff - 現在着目しているピクセルと、その近傍のうち連結成分に属するピクセル(または成分に追加されるシードピクセル)との間で許容される最大の輝度/色の上方向の差。
        rect - 省略可能な出力引数。再描画された領域の最小バウンディング矩形が関数によって設定される。4は、最も近い4つの近傍ピクセル(エッジを共有するもの)のみが考慮されることを意味する。連結性の値が8の場合は、最も近い8つの近傍ピクセル(コーナーを共有するもの)が考慮される。次の8ビット(8〜16)には、マスクを埋めるための1から255の間の値が含まれる(デフォルト値は1)。例えば、4 | ( 255 << 8 ) は4近傍を考慮し、マスクを値255で埋める。以下の追加オプションはさらに上位のビットを占めるため、ビット単位の論理和(|)を用いて連結性やマスク埋め値とさらに組み合わせることができる。#FloodFillFlags を参照。覚え書き: マスクは塗りつぶし対象画像より大きいため、image 内のピクセル \((x, y)\) はマスク内のピクセル \((x+1, y+1)\) に対応する。SEE: findContours
        戻り値:
        自動生成
      • floodFill

        public static int floodFill​(Mat image,
                                    Mat mask,
                                    Point seedPoint,
                                    Scalar newVal,
                                    Rect rect,
                                    Scalar loDiff)
        Fills a connected component with the given color. The function cv::floodFill fills a connected component starting from the seed point with the specified color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The pixel at \((x,y)\) is considered to belong to the repainted domain if:
        • グレースケール画像かつ変動範囲の場合 \(\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\)
        • グレースケール画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\)
        • カラー画像かつ変動範囲の場合 \(\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\) \(\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\)
        • カラー画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\) \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\)
        where \(src(x',y')\) is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:
        • 浮動範囲 (floating range) の場合は、すでに連結成分に属する隣接ピクセルのうちの1つの色/明るさ。
        • 固定範囲 (fixed range) の場合は、シード点の色/明るさ。
        Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on.
        引数:
        image - 入出力用の1チャンネルまたは3チャンネル、8ビットまたは浮動小数点の画像。関数の2番目の変種で #FLOODFILL_MASK_ONLY フラグが設定されていない限り、この関数によって変更される。詳細は以下を参照。
        mask - 操作用マスク。シングルチャンネルの8ビット画像で、image より幅・高さともに2ピクセル大きくなければならない。空の Mat が渡された場合は自動的に作成される。これは入力と出力の両方を兼ねる引数であるため、初期化の責任は呼び出し側にある。塗りつぶしは入力マスク内の非ゼロピクセルを越えて進むことはできない。例えば、エッジ検出器の出力をマスクとして用いることで、エッジで塗りつぶしを止めることができる。出力時には、image 内の塗りつぶされたピクセルに対応するマスク内のピクセルが、1または以下で説明する flags で指定された値に設定される。さらに、関数は内部処理を簡略化するためにマスクの境界を1で埋める。したがって、複数回の関数呼び出しで同じマスクを使用すれば、塗りつぶされた領域が重ならないようにすることができる。
        seedPoint - 開始点。
        newVal - 再描画される領域のピクセルの新しい値。
        loDiff - 現在着目しているピクセルと、その近傍のうち連結成分に属するピクセル(または成分に追加されるシードピクセル)との間で許容される最大の輝度/色の下方向の差。その近傍のうち連結成分に属するピクセル、または成分に追加されるシードピクセルとの差。
        rect - 省略可能な出力引数。再描画された領域の最小バウンディング矩形が関数によって設定される。4は、最も近い4つの近傍ピクセル(エッジを共有するもの)のみが考慮されることを意味する。連結性の値が8の場合は、最も近い8つの近傍ピクセル(コーナーを共有するもの)が考慮される。次の8ビット(8〜16)には、マスクを埋めるための1から255の間の値が含まれる(デフォルト値は1)。例えば、4 | ( 255 << 8 ) は4近傍を考慮し、マスクを値255で埋める。以下の追加オプションはさらに上位のビットを占めるため、ビット単位の論理和(|)を用いて連結性やマスク埋め値とさらに組み合わせることができる。#FloodFillFlags を参照。覚え書き: マスクは塗りつぶし対象画像より大きいため、image 内のピクセル \((x, y)\) はマスク内のピクセル \((x+1, y+1)\) に対応する。SEE: findContours
        戻り値:
        自動生成
      • floodFill

        public static int floodFill​(Mat image,
                                    Mat mask,
                                    Point seedPoint,
                                    Scalar newVal,
                                    Rect rect)
        Fills a connected component with the given color. The function cv::floodFill fills a connected component starting from the seed point with the specified color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The pixel at \((x,y)\) is considered to belong to the repainted domain if:
        • グレースケール画像かつ変動範囲の場合 \(\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\)
        • グレースケール画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\)
        • カラー画像かつ変動範囲の場合 \(\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\) \(\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\)
        • カラー画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\) \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\)
        where \(src(x',y')\) is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:
        • 浮動範囲 (floating range) の場合は、すでに連結成分に属する隣接ピクセルのうちの1つの色/明るさ。
        • 固定範囲 (fixed range) の場合は、シード点の色/明るさ。
        Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on.
        引数:
        image - 入出力用の1チャンネルまたは3チャンネル、8ビットまたは浮動小数点の画像。関数の2番目の変種で #FLOODFILL_MASK_ONLY フラグが設定されていない限り、この関数によって変更される。詳細は以下を参照。
        mask - 操作用マスク。シングルチャンネルの8ビット画像で、image より幅・高さともに2ピクセル大きくなければならない。空の Mat が渡された場合は自動的に作成される。これは入力と出力の両方を兼ねる引数であるため、初期化の責任は呼び出し側にある。塗りつぶしは入力マスク内の非ゼロピクセルを越えて進むことはできない。例えば、エッジ検出器の出力をマスクとして用いることで、エッジで塗りつぶしを止めることができる。出力時には、image 内の塗りつぶされたピクセルに対応するマスク内のピクセルが、1または以下で説明する flags で指定された値に設定される。さらに、関数は内部処理を簡略化するためにマスクの境界を1で埋める。したがって、複数回の関数呼び出しで同じマスクを使用すれば、塗りつぶされた領域が重ならないようにすることができる。
        seedPoint - 開始点。
        newVal - 再描画される領域のピクセルの新しい値。その近傍のうち連結成分に属するピクセル、または成分に追加されるシードピクセルとの差。その近傍のうち連結成分に属するピクセル、または成分に追加されるシードピクセルとの差。
        rect - 省略可能な出力引数。再描画された領域の最小バウンディング矩形が関数によって設定される。4は、最も近い4つの近傍ピクセル(エッジを共有するもの)のみが考慮されることを意味する。連結性の値が8の場合は、最も近い8つの近傍ピクセル(コーナーを共有するもの)が考慮される。次の8ビット(8〜16)には、マスクを埋めるための1から255の間の値が含まれる(デフォルト値は1)。例えば、4 | ( 255 << 8 ) は4近傍を考慮し、マスクを値255で埋める。以下の追加オプションはさらに上位のビットを占めるため、ビット単位の論理和(|)を用いて連結性やマスク埋め値とさらに組み合わせることができる。#FloodFillFlags を参照。覚え書き: マスクは塗りつぶし対象画像より大きいため、image 内のピクセル \((x, y)\) はマスク内のピクセル \((x+1, y+1)\) に対応する。SEE: findContours
        戻り値:
        自動生成
      • floodFill

        public static int floodFill​(Mat image,
                                    Mat mask,
                                    Point seedPoint,
                                    Scalar newVal)
        Fills a connected component with the given color. The function cv::floodFill fills a connected component starting from the seed point with the specified color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The pixel at \((x,y)\) is considered to belong to the repainted domain if:
        • グレースケール画像かつ変動範囲の場合 \(\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}\)
        • グレースケール画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}\)
        • カラー画像かつ変動範囲の場合 \(\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,\) \(\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b\)
        • カラー画像かつ固定範囲の場合 \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,\) \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g\) かつ \(\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b\)
        where \(src(x',y')\) is the value of one of pixel neighbors that is already known to belong to the component. That is, to be added to the connected component, a color/brightness of the pixel should be close enough to:
        • 浮動範囲 (floating range) の場合は、すでに連結成分に属する隣接ピクセルのうちの1つの色/明るさ。
        • 固定範囲 (fixed range) の場合は、シード点の色/明るさ。
        Use these functions to either mark a connected component with the specified color in-place, or build a mask and then extract the contour, or copy the region to another image, and so on.
        引数:
        image - 入出力用の1チャンネルまたは3チャンネル、8ビットまたは浮動小数点の画像。関数の2番目の変種で #FLOODFILL_MASK_ONLY フラグが設定されていない限り、この関数によって変更される。詳細は以下を参照。
        mask - 操作用マスク。シングルチャンネルの8ビット画像で、image より幅・高さともに2ピクセル大きくなければならない。空の Mat が渡された場合は自動的に作成される。これは入力と出力の両方を兼ねる引数であるため、初期化の責任は呼び出し側にある。塗りつぶしは入力マスク内の非ゼロピクセルを越えて進むことはできない。例えば、エッジ検出器の出力をマスクとして用いることで、エッジで塗りつぶしを止めることができる。出力時には、image 内の塗りつぶされたピクセルに対応するマスク内のピクセルが、1または以下で説明する flags で指定された値に設定される。さらに、関数は内部処理を簡略化するためにマスクの境界を1で埋める。したがって、複数回の関数呼び出しで同じマスクを使用すれば、塗りつぶされた領域が重ならないようにすることができる。
        seedPoint - 開始点。
        newVal - 再描画される領域のピクセルの新しい値。その近傍のうち連結成分に属するピクセル、または成分に追加されるシードピクセルとの差。その近傍のうち連結成分に属するピクセル、または成分に追加されるシードピクセルとの差。再描画された領域。4は、最も近い4つの近傍ピクセル(エッジを共有するもの)のみが考慮されることを意味する。連結性の値が8の場合は、最も近い8つの近傍ピクセル(コーナーを共有するもの)が考慮される。次の8ビット(8〜16)には、マスクを埋めるための1から255の間の値が含まれる(デフォルト値は1)。例えば、4 | ( 255 << 8 ) は4近傍を考慮し、マスクを値255で埋める。以下の追加オプションはさらに上位のビットを占めるため、ビット単位の論理和(|)を用いて連結性やマスク埋め値とさらに組み合わせることができる。#FloodFillFlags を参照。覚え書き: マスクは塗りつぶし対象画像より大きいため、image 内のピクセル \((x, y)\) はマスク内のピクセル \((x+1, y+1)\) に対応する。SEE: findContours
        戻り値:
        自動生成
      • blendLinear

        public static void blendLinear​(Mat src1,
                                       Mat src2,
                                       Mat weights1,
                                       Mat weights2,
                                       Mat dst)
        variant without mask parameter
        引数:
        src1 - 自動生成
        src2 - 自動生成
        weights1 - 自動生成された説明
        weights2 - 自動生成された説明
        dst - 自動生成
      • cvtColor

        public static void cvtColor​(Mat src,
                                    Mat dst,
                                    int code,
                                    int dstCn,
                                    int hint)
        Converts an image from one color space to another. The function converts an input image from one color space to another. In case of a transformation to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on. The conventional ranges for R, G, and B channel values are:
        • CV_8U 画像では 0 から 255
        • CV_16U 画像では 0 から 65535
        • CV_32F 画像では 0 から 1
        In case of linear transformations, the range does not matter. But in case of a non-linear transformation, an input RGB image should be normalized to the proper value range to get the correct results, for example, for RGB \(\rightarrow\) L\*u\*v\* transformation. For example, if you have a 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will have the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor , you need first to scale the image down: img *= 1./255; cvtColor(img, img, COLOR_BGR2Luv); If you use #cvtColor with 8-bit images, the conversion will have some information lost. For many applications, this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back. If conversion adds the alpha channel, its value will set to the maximum of corresponding channel range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
        引数:
        src - 入力画像。8ビット符号なし、16ビット符号なし( CV_16UC... )、または単精度浮動小数点。
        dst - src と同じサイズおよびビット深度の出力画像。
        code - 色空間変換コード(#ColorConversionCodes を参照)。
        dstCn - 出力画像のチャンネル数。引数が0の場合、チャンネル数は src と code から自動的に導出される。
        hint - 実装の変更フラグ。#AlgorithmHint を参照。覚え書き: 入力画像(src)は、目的の色変換に適した型でなければならない。ColorConversionCodes を参照。SEE: REF: imgproc_color_conversions
      • cvtColor

        public static void cvtColor​(Mat src,
                                    Mat dst,
                                    int code,
                                    int dstCn)
        Converts an image from one color space to another. The function converts an input image from one color space to another. In case of a transformation to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on. The conventional ranges for R, G, and B channel values are:
        • CV_8U 画像では 0 から 255
        • CV_16U 画像では 0 から 65535
        • CV_32F 画像では 0 から 1
        In case of linear transformations, the range does not matter. But in case of a non-linear transformation, an input RGB image should be normalized to the proper value range to get the correct results, for example, for RGB \(\rightarrow\) L\*u\*v\* transformation. For example, if you have a 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will have the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor , you need first to scale the image down: img *= 1./255; cvtColor(img, img, COLOR_BGR2Luv); If you use #cvtColor with 8-bit images, the conversion will have some information lost. For many applications, this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back. If conversion adds the alpha channel, its value will set to the maximum of corresponding channel range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
        引数:
        src - 入力画像。8ビット符号なし、16ビット符号なし( CV_16UC... )、または単精度浮動小数点。
        dst - src と同じサイズおよびビット深度の出力画像。
        code - 色空間変換コード(#ColorConversionCodes を参照)。
        dstCn - 出力画像のチャンネル数。引数が0の場合、チャンネル数は src と code から自動的に導出される。覚え書き: 入力画像(src)は、目的の色変換に適した型でなければならない。ColorConversionCodes を参照。SEE: REF: imgproc_color_conversions
      • cvtColor

        public static void cvtColor​(Mat src,
                                    Mat dst,
                                    int code)
        Converts an image from one color space to another. The function converts an input image from one color space to another. In case of a transformation to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on. The conventional ranges for R, G, and B channel values are:
        • CV_8U 画像では 0 から 255
        • CV_16U 画像では 0 から 65535
        • CV_32F 画像では 0 から 1
        In case of linear transformations, the range does not matter. But in case of a non-linear transformation, an input RGB image should be normalized to the proper value range to get the correct results, for example, for RGB \(\rightarrow\) L\*u\*v\* transformation. For example, if you have a 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will have the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor , you need first to scale the image down: img *= 1./255; cvtColor(img, img, COLOR_BGR2Luv); If you use #cvtColor with 8-bit images, the conversion will have some information lost. For many applications, this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back. If conversion adds the alpha channel, its value will set to the maximum of corresponding channel range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
        引数:
        src - 入力画像。8ビット符号なし、16ビット符号なし( CV_16UC... )、または単精度浮動小数点。
        dst - src と同じサイズおよびビット深度の出力画像。
        code - 色空間変換コード(#ColorConversionCodes を参照)。チャンネル数は src と code から自動的に導出される。覚え書き: 入力画像(src)は、目的の色変換に適した型でなければならない。ColorConversionCodes を参照。SEE: REF: imgproc_color_conversions
      • cvtColorTwoPlane

        public static void cvtColorTwoPlane​(Mat src1,
                                            Mat src2,
                                            Mat dst,
                                            int code,
                                            int hint)
        Converts an image from one color space to another where the source image is stored in two planes. This function only supports YUV420 to RGB conversion as of now.
        引数:
        src1 - Yプレーンの8ビット画像(#CV_8U)。
        src2 - U/Vプレーンがインターリーブされた画像。
        dst - 出力画像。
        code - Specifies the type of conversion. It can take any of the following values:
        • #COLOR_YUV2BGR_NV12
        • #COLOR_YUV2RGB_NV12
        • #COLOR_YUV2BGRA_NV12
        • #COLOR_YUV2RGBA_NV12
        • #COLOR_YUV2BGR_NV21
        • #COLOR_YUV2RGB_NV21
        • #COLOR_YUV2BGRA_NV21
        • #COLOR_YUV2RGBA_NV21
        hint - 実装の変更フラグ。#AlgorithmHint を参照。
      • cvtColorTwoPlane

        public static void cvtColorTwoPlane​(Mat src1,
                                            Mat src2,
                                            Mat dst,
                                            int code)
        Converts an image from one color space to another where the source image is stored in two planes. This function only supports YUV420 to RGB conversion as of now.
        引数:
        src1 - Yプレーンの8ビット画像(#CV_8U)。
        src2 - U/Vプレーンがインターリーブされた画像。
        dst - 出力画像。
        code - Specifies the type of conversion. It can take any of the following values:
        • #COLOR_YUV2BGR_NV12
        • #COLOR_YUV2RGB_NV12
        • #COLOR_YUV2BGRA_NV12
        • #COLOR_YUV2RGBA_NV12
        • #COLOR_YUV2BGR_NV21
        • #COLOR_YUV2RGB_NV21
        • #COLOR_YUV2BGRA_NV21
        • #COLOR_YUV2RGBA_NV21
      • demosaicing

        public static void demosaicing​(Mat src,
                                       Mat dst,
                                       int code,
                                       int dstCn)
        main function for all demosaicing processes
        引数:
        src - 入力画像。8ビット符号なしまたは16ビット符号なし。
        dst - src と同じサイズおよびビット深度の出力画像。
        code - 色空間変換コード(以下の説明を参照)。
        dstCn - number of channels in the destination image; if the parameter is 0, the number of the channels is derived automatically from src and code. The function can do the following transformations:
        • バイリニア補間を用いたデモザイク処理
        #COLOR_BayerBG2BGR , #COLOR_BayerGB2BGR , #COLOR_BayerRG2BGR , #COLOR_BayerGR2BGR #COLOR_BayerBG2GRAY , #COLOR_BayerGB2GRAY , #COLOR_BayerRG2GRAY , #COLOR_BayerGR2GRAY
        • 可変数勾配 (Variable Number of Gradients) を用いたデモザイク処理。
        #COLOR_BayerBG2BGR_VNG , #COLOR_BayerGB2BGR_VNG , #COLOR_BayerRG2BGR_VNG , #COLOR_BayerGR2BGR_VNG
        • エッジを考慮したデモザイク処理。
        #COLOR_BayerBG2BGR_EA , #COLOR_BayerGB2BGR_EA , #COLOR_BayerRG2BGR_EA , #COLOR_BayerGR2BGR_EA
        • アルファチャンネル付きのデモザイク処理
        #COLOR_BayerBG2BGRA , #COLOR_BayerGB2BGRA , #COLOR_BayerRG2BGRA , #COLOR_BayerGR2BGRA 覚え書き: The source image (src) must be of an appropriate type for the desired color conversion. see ColorConversionCodes SEE: cvtColor
      • demosaicing

        public static void demosaicing​(Mat src,
                                       Mat dst,
                                       int code)
        main function for all demosaicing processes
        引数:
        src - 入力画像。8ビット符号なしまたは16ビット符号なし。
        dst - src と同じサイズおよびビット深度の出力画像。
        code - Color space conversion code (see the description below). channels is derived automatically from src and code. The function can do the following transformations:
        • バイリニア補間を用いたデモザイク処理
        #COLOR_BayerBG2BGR , #COLOR_BayerGB2BGR , #COLOR_BayerRG2BGR , #COLOR_BayerGR2BGR #COLOR_BayerBG2GRAY , #COLOR_BayerGB2GRAY , #COLOR_BayerRG2GRAY , #COLOR_BayerGR2GRAY
        • 可変数勾配 (Variable Number of Gradients) を用いたデモザイク処理。
        #COLOR_BayerBG2BGR_VNG , #COLOR_BayerGB2BGR_VNG , #COLOR_BayerRG2BGR_VNG , #COLOR_BayerGR2BGR_VNG
        • エッジを考慮したデモザイク処理。
        #COLOR_BayerBG2BGR_EA , #COLOR_BayerGB2BGR_EA , #COLOR_BayerRG2BGR_EA , #COLOR_BayerGR2BGR_EA
        • アルファチャンネル付きのデモザイク処理
        #COLOR_BayerBG2BGRA , #COLOR_BayerGB2BGRA , #COLOR_BayerRG2BGRA , #COLOR_BayerGR2BGRA 覚え書き: The source image (src) must be of an appropriate type for the desired color conversion. see ColorConversionCodes SEE: cvtColor
      • moments

        public static Moments moments​(Mat array,
                                      boolean binaryImage)
        Calculates all of the moments up to the third order of a polygon or rasterized shape. The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The results are returned in the structure cv::Moments.
        引数:
        array - シングルチャンネルのラスタ画像(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F)、または2D点(Point または Point2f)の配列( \(1 \times N\) または \(N \times 1\) )。
        binaryImage - true の場合、すべての非ゼロの画像ピクセルが1として扱われる。この引数は画像に対してのみ使用される。
        戻り値:
        モーメント。覚え書き: Pythonバインディングからの輪郭モーメント計算にのみ適用される。入力配列のnumpy型は np.int32 または np.float32 のいずれかでなければならない点に注意。覚え書き: 輪郭ベースのモーメントの場合、0次モーメント \c m00 は輪郭の面積を表す。入力された輪郭が退化している場合(例えば単一の点、またはすべての点が一直線上にある場合)、面積はゼロとなり、したがって \c m00 == 0 となる。この場合、重心座標(\c m10/m00, \c m01/m00)は未定義となり、呼び出し側が明示的に処理しなければならない。一般的な回避策としては、cv::boundingRect() を使うか、入力点を平均することで中心を計算する方法がある。SEE: contourArea, arcLength
      • moments

        public static Moments moments​(Mat array)
        Calculates all of the moments up to the third order of a polygon or rasterized shape. The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The results are returned in the structure cv::Moments.
        引数:
        array - シングルチャンネルのラスタ画像(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F)、または2D点(Point または Point2f)の配列( \(1 \times N\) または \(N \times 1\) )。画像に対してのみ使用される。
        戻り値:
        モーメント。覚え書き: Pythonバインディングからの輪郭モーメント計算にのみ適用される。入力配列のnumpy型は np.int32 または np.float32 のいずれかでなければならない点に注意。覚え書き: 輪郭ベースのモーメントの場合、0次モーメント \c m00 は輪郭の面積を表す。入力された輪郭が退化している場合(例えば単一の点、またはすべての点が一直線上にある場合)、面積はゼロとなり、したがって \c m00 == 0 となる。この場合、重心座標(\c m10/m00, \c m01/m00)は未定義となり、呼び出し側が明示的に処理しなければならない。一般的な回避策としては、cv::boundingRect() を使うか、入力点を平均することで中心を計算する方法がある。SEE: contourArea, arcLength
      • HuMoments

        public static void HuMoments​(Moments m,
                                     Mat hu)
      • matchTemplate

        public static void matchTemplate​(Mat image,
                                         Mat templ,
                                         Mat result,
                                         int method,
                                         Mat mask)
        Compares a template against overlapped image regions. The function slides through image , compares the overlapped patches of size \(w \times h\) against templ using the specified method and stores the comparison results in result . #TemplateMatchModes describes the formulae for the available comparison methods ( \(I\) denotes image, \(T\) template, \(R\) result, \(M\) the optional mask ). The summation is done over template and/or the image patch: \(x' = 0...w-1, y' = 0...h-1\) After the function finishes the comparison, the best matches can be found as global minimums (when #TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the #minMaxLoc function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
        引数:
        image - 探索を実行する対象の画像。8ビットまたは32ビット浮動小数点でなければならない。
        templ - 探索するテンプレート。元画像より大きくてはならず、同じデータ型を持たなければならない。
        result - 比較結果のマップ。シングルチャンネルの32ビット浮動小数点でなければならない。image が \(W \times H\) で templ が \(w \times h\) の場合、result は \((W-w+1) \times (H-h+1)\) となる。
        method - 比較方法を指定する引数。#TemplateMatchModes を参照。
        mask - 省略可能なマスク。templ と同じサイズでなければならない。テンプレートと同じチャンネル数を持つか、または1チャンネルのみ(その場合はすべてのテンプレートおよび画像チャンネルに使用される)でなければならない。データ型が #CV_8U の場合、マスクはバイナリマスクとして解釈され、マスクが非ゼロの要素のみが使用され、実際のマスク値に関係なくそのまま保持される(重みは1に等しい)。データ型が #CV_32F の場合、マスク値は重みとして使用される。正確な計算式は #TemplateMatchModes に記載されている。
      • matchTemplate

        public static void matchTemplate​(Mat image,
                                         Mat templ,
                                         Mat result,
                                         int method)
        Compares a template against overlapped image regions. The function slides through image , compares the overlapped patches of size \(w \times h\) against templ using the specified method and stores the comparison results in result . #TemplateMatchModes describes the formulae for the available comparison methods ( \(I\) denotes image, \(T\) template, \(R\) result, \(M\) the optional mask ). The summation is done over template and/or the image patch: \(x' = 0...w-1, y' = 0...h-1\) After the function finishes the comparison, the best matches can be found as global minimums (when #TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the #minMaxLoc function. In case of a color image, template summation in the numerator and each sum in the denominator is done over all of the channels and separate mean values are used for each channel. That is, the function can take a color template and a color image. The result will still be a single-channel image, which is easier to analyze.
        引数:
        image - 探索を実行する対象の画像。8ビットまたは32ビット浮動小数点でなければならない。
        templ - 探索するテンプレート。元画像より大きくてはならず、同じデータ型を持たなければならない。
        result - 比較結果のマップ。シングルチャンネルの32ビット浮動小数点でなければならない。image が \(W \times H\) で templ が \(w \times h\) の場合、result は \((W-w+1) \times (H-h+1)\) となる。
        method - 比較方法を指定する引数。#TemplateMatchModes を参照。テンプレートと同じチャンネル数を持つか、または1チャンネルのみ(その場合はすべてのテンプレートおよび画像チャンネルに使用される)でなければならない。データ型が #CV_8U の場合、マスクはバイナリマスクとして解釈され、マスクが非ゼロの要素のみが使用され、実際のマスク値に関係なくそのまま保持される(重みは1に等しい)。データ型が #CV_32F の場合、マスク値は重みとして使用される。正確な計算式は #TemplateMatchModes に記載されている。
      • connectedComponentsWithAlgorithm

        public static int connectedComponentsWithAlgorithm​(Mat image,
                                                           Mat labels,
                                                           int connectivity,
                                                           int ltype,
                                                           int ccltype)
        computes the connected components labeled image of boolean image image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image. ccltype specifies the connected components labeling algorithm to use, currently Bolelli (Spaghetti) CITE: Bolelli2019, Grana (BBDT) CITE: Grana2010 and Wu's (SAUF) CITE: Wu2009 algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces a row major ordering of labels while Spaghetti and BBDT do not. This function uses parallel version of the algorithms if at least one allowed parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        connectivity - 8連結または4連結に対してそれぞれ8または4
        ltype - 出力画像のラベル型。現在は CV_32S と CV_16U がサポートされている。
        ccltype - 連結成分アルゴリズムの種類(#ConnectedComponentsAlgorithmsTypes を参照)。
        戻り値:
        自動生成
      • connectedComponents

        public static int connectedComponents​(Mat image,
                                              Mat labels,
                                              int connectivity,
                                              int ltype)
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        connectivity - 8連結または4連結に対してそれぞれ8または4
        ltype - 出力画像のラベル型。現在は CV_32S と CV_16U がサポートされている。
        戻り値:
        自動生成
      • connectedComponents

        public static int connectedComponents​(Mat image,
                                              Mat labels,
                                              int connectivity)
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        connectivity - 8連結または4連結に対してそれぞれ8または4
        戻り値:
        自動生成
      • connectedComponents

        public static int connectedComponents​(Mat image,
                                              Mat labels)
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        戻り値:
        自動生成
      • connectedComponentsWithStatsWithAlgorithm

        public static int connectedComponentsWithStatsWithAlgorithm​(Mat image,
                                                                    Mat labels,
                                                                    Mat stats,
                                                                    Mat centroids,
                                                                    int connectivity,
                                                                    int ltype,
                                                                    int ccltype)
        computes the connected components labeled image of boolean image and also produces a statistics output for each label image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0 represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image. ccltype specifies the connected components labeling algorithm to use, currently Bolelli (Spaghetti) CITE: Bolelli2019, Grana (BBDT) CITE: Grana2010 and Wu's (SAUF) CITE: Wu2009 algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces a row major ordering of labels while Spaghetti and BBDT do not. This function uses parallel version of the algorithms (statistics included) if at least one allowed parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        stats - 背景ラベルを含む各ラベルに対する統計出力。統計は stats(label, COLUMN) で参照し、COLUMN は #ConnectedComponentsTypes のいずれかで、選択する統計量を指定する。データ型は CV_32S。
        centroids - 背景ラベルを含む各ラベルに対する重心出力。重心は x については centroids(label, 0)、y については centroids(label, 1) で参照する。データ型は CV_64F。
        connectivity - 8連結または4連結に対してそれぞれ8または4
        ltype - 出力画像のラベル型。現在は CV_32S と CV_16U がサポートされている。
        ccltype - 連結成分アルゴリズムの種類(#ConnectedComponentsAlgorithmsTypes を参照)。
        戻り値:
        自動生成
      • connectedComponentsWithStats

        public static int connectedComponentsWithStats​(Mat image,
                                                       Mat labels,
                                                       Mat stats,
                                                       Mat centroids,
                                                       int connectivity,
                                                       int ltype)
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        stats - 背景ラベルを含む各ラベルに対する統計出力。統計は stats(label, COLUMN) で参照し、COLUMN は #ConnectedComponentsTypes のいずれかで、選択する統計量を指定する。データ型は CV_32S。
        centroids - 背景ラベルを含む各ラベルに対する重心出力。重心は x については centroids(label, 0)、y については centroids(label, 1) で参照する。データ型は CV_64F。
        connectivity - 8連結または4連結に対してそれぞれ8または4
        ltype - 出力画像のラベル型。現在は CV_32S と CV_16U がサポートされている。
        戻り値:
        自動生成
      • connectedComponentsWithStats

        public static int connectedComponentsWithStats​(Mat image,
                                                       Mat labels,
                                                       Mat stats,
                                                       Mat centroids,
                                                       int connectivity)
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        stats - 背景ラベルを含む各ラベルに対する統計出力。統計は stats(label, COLUMN) で参照し、COLUMN は #ConnectedComponentsTypes のいずれかで、選択する統計量を指定する。データ型は CV_32S。
        centroids - 背景ラベルを含む各ラベルに対する重心出力。重心は x については centroids(label, 0)、y については centroids(label, 1) で参照する。データ型は CV_64F。
        connectivity - 8連結または4連結に対してそれぞれ8または4
        戻り値:
        自動生成
      • connectedComponentsWithStats

        public static int connectedComponentsWithStats​(Mat image,
                                                       Mat labels,
                                                       Mat stats,
                                                       Mat centroids)
        引数:
        image - ラベリング対象の8ビットシングルチャンネル画像
        labels - ラベル付けされた出力画像
        stats - 背景ラベルを含む各ラベルに対する統計出力。統計は stats(label, COLUMN) で参照し、COLUMN は #ConnectedComponentsTypes のいずれかで、選択する統計量を指定する。データ型は CV_32S。
        centroids - 背景ラベルを含む各ラベルに対する重心出力。重心は x については centroids(label, 0)、y については centroids(label, 1) で参照する。データ型は CV_64F。
        戻り値:
        自動生成
      • findContours

        public static void findContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        Mat hierarchy,
                                        int mode,
                                        int method,
                                        Point offset)
        Finds contours in a binary image. The function retrieves contours from the binary image using the algorithm CITE: Suzuki85 . The contours are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the OpenCV sample directory. 覚え書き: Since opencv 3.2 source image is not modified by this function.
        引数:
        image - 入力元の8ビットシングルチャンネル画像。非ゼロのピクセルは1として扱われる。ゼロのピクセルは0のままとなるため、画像はバイナリとして扱われる。グレースケールやカラーの画像からバイナリ画像を作成するには、#compare, #inRange, #threshold , #adaptiveThreshold, #Canny などを使用できる。mode が #RETR_CCOMP または #RETR_FLOODFILL に等しい場合、入力としてラベルの32ビット整数画像(CV_32SC1)を用いることもできる。
        contours - 検出された輪郭。各輪郭は点のベクトルとして格納される(例: std::vector<std::vector<cv::Point> >)。
        hierarchy - 省略可能な出力ベクトル(例: std::vector<cv::Vec4i>)。画像のトポロジに関する情報を含む。要素数は輪郭の数と同じである。i番目の輪郭 contours[i] それぞれについて、要素 hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , hierarchy[i][3] には、それぞれ同じ階層レベルにある次および前の輪郭、最初の子輪郭、親輪郭の、contours における0始まりのインデックスが設定される。輪郭 i に次・前・親・入れ子の輪郭が存在しない場合、hierarchy[i] の対応する要素は負になる。覚え書き: Pythonでは、hierarchy は最上位の配列の内側に入れ子になっている。i番目の輪郭の階層要素にアクセスするには hierarchy[0][i] を使用する。
        mode - 輪郭抽出モード。#RetrievalModes を参照。
        method - 輪郭近似手法。#ContourApproximationModes を参照。
        offset - 各輪郭点をシフトさせる省略可能なオフセット。これは、画像のROIから輪郭を抽出し、その後それらを画像全体の文脈で解析する場合に有用である。
      • findContours

        public static void findContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        Mat hierarchy,
                                        int mode,
                                        int method)
        Finds contours in a binary image. The function retrieves contours from the binary image using the algorithm CITE: Suzuki85 . The contours are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the OpenCV sample directory. 覚え書き: Since opencv 3.2 source image is not modified by this function.
        引数:
        image - 入力元の8ビットシングルチャンネル画像。非ゼロのピクセルは1として扱われる。ゼロのピクセルは0のままとなるため、画像はバイナリとして扱われる。グレースケールやカラーの画像からバイナリ画像を作成するには、#compare, #inRange, #threshold , #adaptiveThreshold, #Canny などを使用できる。mode が #RETR_CCOMP または #RETR_FLOODFILL に等しい場合、入力としてラベルの32ビット整数画像(CV_32SC1)を用いることもできる。
        contours - 検出された輪郭。各輪郭は点のベクトルとして格納される(例: std::vector<std::vector<cv::Point> >)。
        hierarchy - 省略可能な出力ベクトル(例: std::vector<cv::Vec4i>)。画像のトポロジに関する情報を含む。要素数は輪郭の数と同じである。i番目の輪郭 contours[i] それぞれについて、要素 hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , hierarchy[i][3] には、それぞれ同じ階層レベルにある次および前の輪郭、最初の子輪郭、親輪郭の、contours における0始まりのインデックスが設定される。輪郭 i に次・前・親・入れ子の輪郭が存在しない場合、hierarchy[i] の対応する要素は負になる。覚え書き: Pythonでは、hierarchy は最上位の配列の内側に入れ子になっている。i番目の輪郭の階層要素にアクセスするには hierarchy[0][i] を使用する。
        mode - 輪郭抽出モード。#RetrievalModes を参照。
        method - 輪郭近似手法。#ContourApproximationModes を参照。画像のROIから輪郭を抽出し、その後それらを画像全体の文脈で解析する場合に有用である。
      • findContoursLinkRuns

        public static void findContoursLinkRuns​(Mat image,
                                                java.util.List<Mat> contours,
                                                Mat hierarchy)
      • findContoursLinkRuns

        public static void findContoursLinkRuns​(Mat image,
                                                java.util.List<Mat> contours)
      • approxPolyDP

        public static void approxPolyDP​(MatOfPoint2f curve,
                                        MatOfPoint2f approxCurve,
                                        double epsilon,
                                        boolean closed)
        Approximates a polygonal curve(s) with the specified precision. The function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less vertices so that the distance between them is less or equal to the specified precision. It uses the Douglas-Peucker algorithm <https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm>
        引数:
        curve - std::vector または Mat に格納された2D点の入力ベクトル
        approxCurve - 近似の結果。型は入力 curve の型と一致しなければならない。
        epsilon - 近似精度を指定する引数。元の曲線とその近似との間の最大距離である。
        closed - true の場合、近似された曲線は閉じている(最初と最後の頂点が接続される)。そうでない場合は閉じていない。
      • approxPolyN

        public static void approxPolyN​(Mat curve,
                                       Mat approxCurve,
                                       int nsides,
                                       float epsilon_percentage,
                                       boolean ensure_convex)
        Approximates a polygon with a convex hull with a specified accuracy and number of sides. The cv::approxPolyN function approximates a polygon with a convex hull so that the difference between the contour area of the original contour and the new polygon is minimal. It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal. Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered. Each vertex will lie either on the original contour or outside it. The algorithm based on the paper CITE: LowIlie2003 .
        引数:
        curve - std::vector または Mat に格納された2D点群の入力ベクトル。点は float または整数でなければならない。
        approxCurve - 近似の結果。型は std::vector または Mat に格納された2D点(Point2f または Point)のベクトルである。
        nsides - 結果の多角形の辺の数を定義する引数。
        epsilon_percentage - 追加面積の最大値に対する割合を定義する。-1 の場合は使用されない。そうでない場合、追加面積が contourArea(_curve) * percentage より大きくなるとアルゴリズムは停止する。追加面積が上限を超えた場合、アルゴリズムは上限を超えた時点での頂点数をそのまま返す。
        ensure_convex - true の場合、アルゴリズムは入力輪郭の凸包を作成する。そうでない場合、入力ベクトルは凸である必要がある。
      • approxPolyN

        public static void approxPolyN​(Mat curve,
                                       Mat approxCurve,
                                       int nsides,
                                       float epsilon_percentage)
        Approximates a polygon with a convex hull with a specified accuracy and number of sides. The cv::approxPolyN function approximates a polygon with a convex hull so that the difference between the contour area of the original contour and the new polygon is minimal. It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal. Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered. Each vertex will lie either on the original contour or outside it. The algorithm based on the paper CITE: LowIlie2003 .
        引数:
        curve - std::vector または Mat に格納された2D点群の入力ベクトル。点は float または整数でなければならない。
        approxCurve - 近似の結果。型は std::vector または Mat に格納された2D点(Point2f または Point)のベクトルである。
        nsides - 結果の多角形の辺の数を定義する引数。
        epsilon_percentage - 追加面積の最大値に対する割合を定義する。-1 の場合は使用されない。そうでない場合、追加面積が contourArea(_curve) * percentage より大きくなるとアルゴリズムは停止する。追加面積が上限を超えた場合、アルゴリズムは上限を超えた時点での頂点数をそのまま返す。
      • approxPolyN

        public static void approxPolyN​(Mat curve,
                                       Mat approxCurve,
                                       int nsides)
        Approximates a polygon with a convex hull with a specified accuracy and number of sides. The cv::approxPolyN function approximates a polygon with a convex hull so that the difference between the contour area of the original contour and the new polygon is minimal. It uses a greedy algorithm for contracting two vertices into one in such a way that the additional area is minimal. Straight lines formed by each edge of the convex contour are drawn and the areas of the resulting triangles are considered. Each vertex will lie either on the original contour or outside it. The algorithm based on the paper CITE: LowIlie2003 .
        引数:
        curve - std::vector または Mat に格納された2D点群の入力ベクトル。点は float または整数でなければならない。
        approxCurve - 近似の結果。型は std::vector または Mat に格納された2D点(Point2f または Point)のベクトルである。
        nsides - 結果の多角形の辺の数を定義する引数。-1 の場合は使用されない。そうでない場合、追加面積が contourArea(_curve) * percentage より大きくなるとアルゴリズムは停止する。追加面積が上限を超えた場合、アルゴリズムは上限を超えた時点での頂点数をそのまま返す。
      • arcLength

        public static double arcLength​(MatOfPoint2f curve,
                                       boolean closed)
        Calculates a contour perimeter or a curve length. The function computes a curve length or a closed contour perimeter.
        引数:
        curve - std::vector または Mat に格納された2D点の入力ベクトル。
        closed - 曲線が閉じているかどうかを示すフラグ。
        戻り値:
        自動生成
      • boundingRect

        public static Rect boundingRect​(Mat array)
        Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image. The function calculates and returns the minimal up-right bounding rectangle for the specified point set or non-zero pixels of gray-scale image.
        引数:
        array - std::vector または Mat に格納された入力グレースケール画像または2D点集合。
        戻り値:
        自動生成
      • contourArea

        public static double contourArea​(Mat contour,
                                         boolean oriented)
        Calculates a contour area. The function computes a contour area. Similarly to moments , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong results for contours with self-intersections. Example: vector<Point> contour; contour.push_back(Point2f(0, 0)); contour.push_back(Point2f(10, 0)); contour.push_back(Point2f(10, 10)); contour.push_back(Point2f(5, 4)); double area0 = contourArea(contour); vector<Point> approx; approxPolyDP(contour, approx, 5, true); double area1 = contourArea(approx); cout << "area0 =" << area0 << endl << "area1 =" << area1 << endl << "approx poly vertices" << approx.size() << endl;
        引数:
        contour - std::vector または Mat に格納された2D点(輪郭頂点)の入力ベクトル。
        oriented - 符号付き面積フラグ。true の場合、関数は輪郭の向き(時計回りまたは反時計回り)に応じた符号付きの面積値を返す。この機能を使えば、面積の符号から輪郭の向きを判定できる。デフォルトでは引数は false であり、絶対値が返されることを意味する。
        戻り値:
        自動生成
      • contourArea

        public static double contourArea​(Mat contour)
        Calculates a contour area. The function computes a contour area. Similarly to moments , the area is computed using the Green formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong results for contours with self-intersections. Example: vector<Point> contour; contour.push_back(Point2f(0, 0)); contour.push_back(Point2f(10, 0)); contour.push_back(Point2f(10, 10)); contour.push_back(Point2f(5, 4)); double area0 = contourArea(contour); vector<Point> approx; approxPolyDP(contour, approx, 5, true); double area1 = contourArea(approx); cout << "area0 =" << area0 << endl << "area1 =" << area1 << endl << "approx poly vertices" << approx.size() << endl;
        引数:
        contour - std::vector または Mat に格納された2D点(輪郭頂点)の入力ベクトル。輪郭の向き(時計回りまたは反時計回り)に応じる。この機能を使えば、面積の符号から輪郭の向きを判定できる。デフォルトでは引数は false であり、絶対値が返されることを意味する。
        戻り値:
        自動生成
      • minAreaRect

        public static RotatedRect minAreaRect​(MatOfPoint2f points)
        Finds a rotated rectangle of the minimum area enclosing the input 2D point set. The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a specified point set. The angle of rotation represents the angle between the line connecting the starting and ending points (based on the clockwise order with greatest index for the corner with greatest \(y\)) and the horizontal axis. This angle always falls between \([-90, 0)\) because, if the object rotates more than a rect angle, the next edge is used to measure the angle. The starting and ending points change as the object rotates.Developer should keep in mind that the returned RotatedRect can contain negative indices when data is close to the containing Mat element boundary.
        引数:
        points - std::vector<> または Mat に格納された2D点の入力ベクトル
        戻り値:
        自動生成
      • boxPoints

        public static void boxPoints​(RotatedRect box,
                                     Mat points)
        Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle. The function finds the four vertices of a rotated rectangle. The four vertices are returned in clockwise order starting from the point with greatest \(y\). If two points have the same \(y\) coordinate the rightmost is the starting point. This function is useful to draw the rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please visit the REF: tutorial_bounding_rotated_ellipses "tutorial on Creating Bounding rotated boxes and ellipses for contours" for more information.
        引数:
        box - 入力の回転矩形。REF: minAreaRect の出力でもよい。
        points - 矩形の4つの頂点を格納する出力配列。
      • minEnclosingCircle

        public static void minEnclosingCircle​(MatOfPoint2f points,
                                              Point center,
                                              float[] radius)
        Finds a circle of the minimum area enclosing a 2D point set. The function finds the minimal enclosing circle of a 2D point set using an iterative algorithm.
        引数:
        points - std::vector<> または Mat に格納された2D点の入力ベクトル
        center - 円の中心の出力。
        radius - 円の半径の出力。
      • minEnclosingTriangle

        public static double minEnclosingTriangle​(Mat points,
                                                  Mat triangle)
        Finds a triangle of minimum area enclosing a 2D point set and returns its area. The function finds a triangle of minimum area enclosing the given set of 2D points and returns its area. The output for a given 2D point set is shown in the image below. 2D points are depicted in red* and the enclosing triangle in *yellow*. ![Sample output of the minimum enclosing triangle function](pics/minenclosingtriangle.png) The implementation of the algorithm is based on O'Rourke's CITE: ORourke86 and Klee and Laskowski's CITE: KleeLaskowski85 papers. O'Rourke provides a \(\theta(n)\) algorithm for finding the minimal enclosing triangle of a 2D convex polygon with n vertices. Since the #minEnclosingTriangle function takes a 2D point set as input an additional preprocessing step of computing the convex hull of the 2D point set is required. The complexity of the #convexHull function is \(O(n log(n))\) which is higher than \(\theta(n)\). Thus the overall complexity of the function is \(O(n log(n))\).
        引数:
        points - ビット深度 CV_32S または CV_32F の2D点の入力ベクトル。std::vector<> または Mat に格納される
        triangle - 三角形の頂点を定義する3つの2D点の出力ベクトル。OutputArray のビット深度は CV_32F でなければならない。
        戻り値:
        自動生成
      • minEnclosingConvexPolygon

        public static double minEnclosingConvexPolygon​(Mat points,
                                                       Mat polygon,
                                                       int k)
        Finds a convex polygon of minimum area enclosing a 2D point set and returns its area. This function takes a given set of 2D points and finds the enclosing polygon with k vertices and minimal area. It takes the set of points and the parameter k as input and returns the area of the minimal enclosing polygon. The Implementation is based on a paper by Aggarwal, Chang and Yap CITE: Aggarwal1985. They provide a \(\theta(n²log(n)log(k))\) algorithm for finding the minimal convex polygon with k vertices enclosing a 2D convex polygon with n vertices (k < n). Since the #minEnclosingConvexPolygon function takes a 2D point set as input, an additional preprocessing step of computing the convex hull of the 2D point set is required. The complexity of the #convexHull function is \(O(n log(n))\) which is lower than \(\theta(n²log(n)log(k))\). Thus the overall complexity of the function is \(O(n²log(n)log(k))\).
        引数:
        points - std::vector<> または Mat に格納された2D点の入力ベクトル
        polygon - 包含多角形の頂点を定義する2D点の出力ベクトル
        k - 出力多角形の頂点数
        戻り値:
        自動生成
      • matchShapes

        public static double matchShapes​(Mat contour1,
                                         Mat contour2,
                                         int method,
                                         double parameter)
        Compares two shapes. The function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)
        引数:
        contour1 - 1つ目の輪郭またはグレースケール画像。
        contour2 - 2つ目の輪郭またはグレースケール画像。
        method - 比較方法。#ShapeMatchModes を参照。
        parameter - 方法固有の引数(現在はサポートされていない)。
        戻り値:
        自動生成
      • convexHull

        public static void convexHull​(MatOfPoint points,
                                      MatOfInt hull,
                                      boolean clockwise)
        Finds the convex hull of a point set. The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm CITE: Sklansky82 that has *O(N logN)* complexity in the current implementation.
        引数:
        points - std::vector または Mat に格納された入力2D点集合。
        hull - 出力される凸包。インデックスの整数ベクトルまたは点のベクトルのいずれかである。前者の場合、凸包の要素は元の配列における凸包の点の0始まりのインデックスである(凸包の点の集合は元の点集合の部分集合であるため)。後者の場合、凸包の要素は凸包の点そのものである。
        clockwise - 向きを示すフラグ。true の場合、出力される凸包は時計回りに向き付けされる。そうでない場合は反時計回りに向き付けされる。想定する座標系は、X軸が右を、Y軸が上を向く。凸包の点を返す。そうでない場合は凸包の点のインデックスを返す。出力配列が std::vector の場合、このフラグは無視され、出力はベクトルの型に依存する。std::vector<int> は returnPoints=false を意味し、std::vector<Point> は returnPoints=true を意味する。覚え書き: points と hull は異なる配列であるべきであり、インプレース処理はサポートされていない。詳細は REF: tutorial_hull "対応するチュートリアル" を参照。役立つリンク: https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
      • convexHull

        public static void convexHull​(MatOfPoint points,
                                      MatOfInt hull)
        Finds the convex hull of a point set. The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm CITE: Sklansky82 that has *O(N logN)* complexity in the current implementation.
        引数:
        points - std::vector または Mat に格納された入力2D点集合。
        hull - 出力される凸包。インデックスの整数ベクトルまたは点のベクトルのいずれかである。前者の場合、凸包の要素は元の配列における凸包の点の0始まりのインデックスである(凸包の点の集合は元の点集合の部分集合であるため)。後者の場合、凸包の要素は凸包の点そのものである。そうでない場合は反時計回りに向き付けされる。想定する座標系は、X軸が右を、Y軸が上を向く。凸包の点を返す。そうでない場合は凸包の点のインデックスを返す。出力配列が std::vector の場合、このフラグは無視され、出力はベクトルの型に依存する。std::vector<int> は returnPoints=false を意味し、std::vector<Point> は returnPoints=true を意味する。覚え書き: points と hull は異なる配列であるべきであり、インプレース処理はサポートされていない。詳細は REF: tutorial_hull "対応するチュートリアル" を参照。役立つリンク: https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
      • convexityDefects

        public static void convexityDefects​(MatOfPoint contour,
                                            MatOfInt convexhull,
                                            MatOfInt4 convexityDefects)
        Finds the convexity defects of a contour. The figure below displays convexity defects of a hand contour: ![image](pics/defects.png)
        引数:
        contour - 入力輪郭。
        convexhull - convexHull を使って得られる凸包。凸包を構成する輪郭点のインデックスを含む必要がある。
        convexityDefects - 凸性欠陥の出力ベクトル。C++ および新しい Python/Java インターフェースでは、各凸性欠陥は4要素の整数ベクトル(別名 #Vec4i)として表現される: (start_index, end_index, farthest_pt_index, fixpt_depth)。ここでインデックスは凸性欠陥の開始点、終了点、最遠点の、元の輪郭における0始まりのインデックスであり、fixpt_depth は最遠の輪郭点と凸包との間の距離の固定小数点近似(小数部8ビット)である。すなわち、ビット深度の浮動小数点値を得るには fixpt_depth/256.0 とする。
      • isContourConvex

        public static boolean isContourConvex​(MatOfPoint contour)
        Tests a contour convexity. The function tests whether the input contour is convex or not. The contour must be simple, that is, without self-intersections. Otherwise, the function output is undefined.
        引数:
        contour - std::vector<> または Mat に格納された2D点の入力ベクトル
        戻り値:
        自動生成
      • intersectConvexConvex

        public static float intersectConvexConvex​(Mat p1,
                                                  Mat p2,
                                                  Mat p12,
                                                  boolean handleNested)
        Finds intersection of two convex polygons
        引数:
        p1 - 1つ目の多角形
        p2 - 2つ目の多角形
        p12 - 交差領域を表す出力多角形
        handleNested - true の場合、一方の多角形がもう一方に完全に包含されているときに交差が検出される。false の場合、交差は検出されない。多角形が辺を共有している場合、または一方の多角形の頂点がもう一方の辺上にある場合は、入れ子とはみなされず、handleNested の値にかかわらず交差が検出される。
        戻り値:
        交差多角形の面積。アルゴリズムが収束していない場合(例: 非凸な入力)は負になることがある。覚え書き: intersectConvexConvex は両方の多角形が凸であることを確認しないため、凸でない場合は不正な結果を返す。
      • intersectConvexConvex

        public static float intersectConvexConvex​(Mat p1,
                                                  Mat p2,
                                                  Mat p12)
        Finds intersection of two convex polygons
        引数:
        p1 - 1つ目の多角形
        p2 - 2つ目の多角形
        p12 - 交差領域を表す出力多角形。false の場合、交差は検出されない。多角形が辺を共有している場合、または一方の多角形の頂点がもう一方の辺上にある場合は、入れ子とはみなされず、handleNested の値にかかわらず交差が検出される。
        戻り値:
        交差多角形の面積。アルゴリズムが収束していない場合(例: 非凸な入力)は負になることがある。覚え書き: intersectConvexConvex は両方の多角形が凸であることを確認しないため、凸でない場合は不正な結果を返す。
      • fitEllipse

        public static RotatedRect fitEllipse​(MatOfPoint2f points)
        Fits an ellipse around a set of 2D points. The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by CITE: Fitzgibbon95 is used. Developer should keep in mind that it is possible that the returned ellipse/rotatedRect data contains negative indices, due to the data points being close to the border of the containing Mat element.
        引数:
        points - std::vector<> または Mat に格納された入力2D点集合 覚え書き: 入力点の型は REF: Point2i または REF: Point2f であり、少なくとも5点が必要である。覚え書き: 楕円フィッティング誤差の計算には REF: getClosestEllipsePoints 関数を使用できる。
        戻り値:
        自動生成
      • fitEllipseAMS

        public static RotatedRect fitEllipseAMS​(Mat points)
        Fits an ellipse around a set of 2D points. The function calculates the ellipse that fits a set of 2D points. It returns the rotated rectangle in which the ellipse is inscribed. The Approximate Mean Square (AMS) proposed by CITE: Taubin1991 is used. For an ellipse, this basis set is \( \chi= \left(x^2, x y, y^2, x, y, 1\right) \), which is a set of six free coefficients \( A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} \). However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \( (a,b) \), the position \( (x_0,y_0) \), and the orientation \( \theta \). This is because the basis set includes lines, quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits. If the fit is found to be a parabolic or hyperbolic function then the standard #fitEllipse method is used. The AMS method restricts the fit to parabolic, hyperbolic and elliptical curves by imposing the condition that \( A^T ( D_x^T D_x + D_y^T D_y) A = 1 \) where the matrices \( Dx \) and \( Dy \) are the partial derivatives of the design matrix \( D \) with respect to x and y. The matrices are formed row by row applying the following to each of the points in the set: \(align*}{ D(i,:)&=\left\{x_i^2, x_i y_i, y_i^2, x_i, y_i, 1\right\} & D_x(i,:)&=\left\{2 x_i,y_i,0,1,0,0\right\} & D_y(i,:)&=\left\{0,x_i,2 y_i,0,1,0\right\} \) The AMS method minimizes the cost function \(equation*}{ \epsilon ^2=\frac{ A^T D^T D A }{ A^T (D_x^T D_x + D_y^T D_y) A^T } \) The minimum cost is found by solving the generalized eigenvalue problem. \(equation*}{ D^T D A = \lambda \left( D_x^T D_x + D_y^T D_y\right) A \)
        引数:
        points - std::vector<> または Mat に格納された入力2D点集合 覚え書き: 入力点の型は REF: Point2i または REF: Point2f であり、少なくとも5点が必要である。覚え書き: 楕円フィッティング誤差の計算には REF: getClosestEllipsePoints 関数を使用できる。
        戻り値:
        自動生成
      • fitEllipseDirect

        public static RotatedRect fitEllipseDirect​(Mat points)
        Fits an ellipse around a set of 2D points. The function calculates the ellipse that fits a set of 2D points. It returns the rotated rectangle in which the ellipse is inscribed. The Direct least square (Direct) method by CITE: oy1998NumericallySD is used. For an ellipse, this basis set is \( \chi= \left(x^2, x y, y^2, x, y, 1\right) \), which is a set of six free coefficients \( A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} \). However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths \( (a,b) \), the position \( (x_0,y_0) \), and the orientation \( \theta \). This is because the basis set includes lines, quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits. The Direct method confines the fit to ellipses by ensuring that \( 4 A_{xx} A_{yy}- A_{xy}^2 > 0 \). The condition imposed is that \( 4 A_{xx} A_{yy}- A_{xy}^2=1 \) which satisfies the inequality and as the coefficients can be arbitrarily scaled is not overly restrictive. \(equation*}{ \epsilon ^2= A^T D^T D A \quad \text{with} \quad A^T C A =1 \quad \text{and} \quad C=\left(\begin{matrix} 0 & 0 & 2 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 & 0 & 0 \\ 2 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{matrix} \right) \) The minimum cost is found by solving the generalized eigenvalue problem. \(equation*}{ D^T D A = \lambda \left( C\right) A \) The system produces only one positive eigenvalue \( \lambda\) which is chosen as the solution with its eigenvector \(\mathbf{u}\). These are used to find the coefficients \(equation*}{ A = \sqrt{\frac{1}{\mathbf{u}^T C \mathbf{u}}} \mathbf{u} \) The scaling factor guarantees that \(A^T C A =1\).
        引数:
        points - std::vector<> または Mat に格納された入力2D点集合 覚え書き: 入力点の型は REF: Point2i または REF: Point2f であり、少なくとも5点が必要である。覚え書き: 楕円フィッティング誤差の計算には REF: getClosestEllipsePoints 関数を使用できる。
        戻り値:
        自動生成
      • getClosestEllipsePoints

        public static void getClosestEllipsePoints​(RotatedRect ellipse_params,
                                                   Mat points,
                                                   Mat closest_pts)
        Compute for each 2d point the nearest 2d point located on a given ellipse. The function computes the nearest 2d location on a given ellipse for a vector of 2d points and is based on CITE: Chatfield2017 code. This function can be used to compute for instance the ellipse fitting error.
        引数:
        ellipse_params - 楕円の引数
        points - 入力2D点
        closest_pts - 各2D点について、与えられた楕円上に位置する対応する最も近い2D点 覚え書き: 入力点の型は REF: Point2i または REF: Point2f である SEE: fitEllipse, fitEllipseAMS, fitEllipseDirect
      • fitLine

        public static void fitLine​(Mat points,
                                   Mat line,
                                   int distType,
                                   double param,
                                   double reps,
                                   double aeps)
        Fits a line to a 2D or 3D point set. The function fitLine fits a line to a 2D or 3D point set by minimizing \(\sum_i \rho(r_i)\) where \(r_i\) is a distance between the \(i^{th}\) point, the line and \(\rho(r)\) is a distance function, one of the following:
        • DIST_L2 \(\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}\)
        • DIST_L1 \(\rho (r) = r\)
        • DIST_L12 \(\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)\)
        • DIST_FAIR \(\rho \left (r \right ) = C^2 \cdot \left ( \frac{r}{C} - \log{\left(1 + \frac{r}{C}\right)} \right ) \quad \text{where} \quad C=1.3998\)
        • DIST_WELSCH \(\rho \left (r \right ) = \frac{C^2}{2} \cdot \left ( 1 - \exp{\left(-\left(\frac{r}{C}\right)^2\right)} \right ) \quad \text{where} \quad C=2.9846\)
        • DIST_HUBER \(\rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345\)
        The algorithm is based on the M-estimator ( <https://en.wikipedia.org/wiki/M-estimator> ) technique that iteratively fits the line using the weighted least-squares algorithm. After each iteration the weights \(w_i\) are adjusted to be inversely proportional to \(\rho(r_i)\) .
        引数:
        points - std::vector<> または Mat に格納された2Dまたは3D点の入力ベクトル。
        line - 出力される直線の引数。2Dフィッティングの場合、4要素のベクトル(Vec4f のような) - (vx, vy, x0, y0) であるべきで、(vx, vy) は直線に共線な正規化ベクトル、(x0, y0) は直線上の点である。3Dフィッティングの場合、6要素のベクトル(Vec6f のような) - (vx, vy, vz, x0, y0, z0) であるべきで、(vx, vy, vz) は直線に共線な正規化ベクトル、(x0, y0, z0) は直線上の点である。
        distType - M推定量で使用される距離。#DistanceTypes を参照。
        param - 一部の距離の種類における数値引数 ( C )。0 の場合は最適値が選択される。
        reps - 半径(座標原点と直線との間の距離)に対する十分な精度。
        aeps - 角度に対する十分な精度。reps と aeps には 0.01 が適切なデフォルト値である。
      • pointPolygonTest

        public static double pointPolygonTest​(MatOfPoint2f contour,
                                              Point pt,
                                              boolean measureDist)
        Performs a point-in-contour test. The function determines whether the point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge) value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively. Otherwise, the return value is a signed distance between the point and the nearest contour edge. See below a sample output of the function where each image pixel is tested against the contour: ![sample output](pics/pointpolygon.png)
        引数:
        contour - 入力輪郭。
        pt - 輪郭に対して判定される点。
        measureDist - true の場合、関数は点から最も近い輪郭エッジまでの符号付き距離を推定する。そうでない場合、関数は点が輪郭の内部にあるかどうかのみを確認する。
        戻り値:
        自動生成
      • rotatedRectangleIntersection

        public static int rotatedRectangleIntersection​(RotatedRect rect1,
                                                       RotatedRect rect2,
                                                       Mat intersectingRegion)
        Finds out if there is any intersection between two rotated rectangles. If there is then the vertices of the intersecting region are returned as well. Below are some examples of intersection configurations. The hatched pattern indicates the intersecting region and the red vertices are returned by the function. ![intersection examples](pics/intersection.png)
        引数:
        rect1 - 1つ目の矩形
        rect2 - 2つ目の矩形
        intersectingRegion - 交差領域の頂点を格納する出力配列。最大8個の頂点を返す。std::vector<cv::Point2f> または CV_32FC2 型の Mx1 の cv::Mat として格納される。
        戻り値:
        #RectanglesIntersectTypes のいずれか
      • createGeneralizedHoughBallard

        public static GeneralizedHoughBallard createGeneralizedHoughBallard()
        Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it.
        戻り値:
        自動生成
      • createGeneralizedHoughGuil

        public static GeneralizedHoughGuil createGeneralizedHoughGuil()
        Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it.
        戻り値:
        自動生成
      • applyColorMap

        public static void applyColorMap​(Mat src,
                                         Mat dst,
                                         int colormap)
        Applies a GNU Octave/MATLAB equivalent colormap on a given image.
        引数:
        src - 入力画像。CV_8UC1 または CV_8UC3 型のグレースケールまたはカラー画像。CV_8UC3 の場合、cv::COLOR_BGR2GRAY を用いて内部的に CV_8UC1 画像が生成される。
        dst - カラーマップを適用した入力画像が結果として得られる。注: dst に対して Mat::create が呼び出される。
        colormap - 適用するカラーマップ。#ColormapTypes を参照。
      • applyColorMap

        public static void applyColorMap​(Mat src,
                                         Mat dst,
                                         Mat userColor)
        Applies a user colormap on a given image.
        引数:
        src - 入力画像。CV_8UC1 または CV_8UC3 型のグレースケールまたはカラー画像。CV_8UC3 の場合、cv::COLOR_BGR2GRAY を用いて内部的に CV_8UC1 画像が生成される。
        dst - userColor と同じチャンネル数で、カラーマップを適用した入力画像が結果として得られる。注: dst に対して Mat::create が呼び出される。
        userColor - 適用するカラーマップ。CV_8UC1 または CV_8UC3 型でサイズ 256。
      • line

        public static void line​(Mat img,
                                Point pt1,
                                Point pt2,
                                Scalar color,
                                int thickness,
                                int lineType,
                                int shift)
        Draws a line segment connecting two points. The function line draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.
        引数:
        img - 画像。
        pt1 - 線分の始点。
        pt2 - 線分の終点。
        color - 線の色。
        thickness - 線の太さ。
        lineType - 線の種類。#LineTypes を参照。
        shift - 点座標の小数部のビット数。
      • line

        public static void line​(Mat img,
                                Point pt1,
                                Point pt2,
                                Scalar color,
                                int thickness,
                                int lineType)
        Draws a line segment connecting two points. The function line draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.
        引数:
        img - 画像。
        pt1 - 線分の始点。
        pt2 - 線分の終点。
        color - 線の色。
        thickness - 線の太さ。
        lineType - 線の種類。#LineTypes を参照。
      • line

        public static void line​(Mat img,
                                Point pt1,
                                Point pt2,
                                Scalar color,
                                int thickness)
        Draws a line segment connecting two points. The function line draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.
        引数:
        img - 画像。
        pt1 - 線分の始点。
        pt2 - 線分の終点。
        color - 線の色。
        thickness - 線の太さ。
      • line

        public static void line​(Mat img,
                                Point pt1,
                                Point pt2,
                                Scalar color)
        Draws a line segment connecting two points. The function line draws the line segment between pt1 and pt2 points in the image. The line is clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased lines are drawn using Gaussian filtering.
        引数:
        img - 画像。
        pt1 - 線分の始点。
        pt2 - 線分の終点。
        color - 線の色。
      • arrowedLine

        public static void arrowedLine​(Mat img,
                                       Point pt1,
                                       Point pt2,
                                       Scalar color,
                                       int thickness,
                                       int line_type,
                                       int shift,
                                       double tipLength)
        Draws an arrow segment pointing from the first point to the second one. The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
        引数:
        img - 画像。
        pt1 - 矢印の始点。
        pt2 - 矢印の指す先の点。
        color - 線の色。
        thickness - 線の太さ。
        line_type - 線の種類。#LineTypes を参照。
        shift - 点座標の小数部のビット数。
        tipLength - 矢印全体の長さに対する矢じり部分の長さ
      • arrowedLine

        public static void arrowedLine​(Mat img,
                                       Point pt1,
                                       Point pt2,
                                       Scalar color,
                                       int thickness,
                                       int line_type,
                                       int shift)
        Draws an arrow segment pointing from the first point to the second one. The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
        引数:
        img - 画像。
        pt1 - 矢印の始点。
        pt2 - 矢印の指す先の点。
        color - 線の色。
        thickness - 線の太さ。
        line_type - 線の種類。#LineTypes を参照。
        shift - 点座標の小数部のビット数。
      • arrowedLine

        public static void arrowedLine​(Mat img,
                                       Point pt1,
                                       Point pt2,
                                       Scalar color,
                                       int thickness,
                                       int line_type)
        Draws an arrow segment pointing from the first point to the second one. The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
        引数:
        img - 画像。
        pt1 - 矢印の始点。
        pt2 - 矢印の指す先の点。
        color - 線の色。
        thickness - 線の太さ。
        line_type - 線の種類。#LineTypes を参照。
      • arrowedLine

        public static void arrowedLine​(Mat img,
                                       Point pt1,
                                       Point pt2,
                                       Scalar color,
                                       int thickness)
        Draws an arrow segment pointing from the first point to the second one. The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
        引数:
        img - 画像。
        pt1 - 矢印の始点。
        pt2 - 矢印の指す先の点。
        color - 線の色。
        thickness - 線の太さ。
      • arrowedLine

        public static void arrowedLine​(Mat img,
                                       Point pt1,
                                       Point pt2,
                                       Scalar color)
        Draws an arrow segment pointing from the first point to the second one. The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
        引数:
        img - 画像。
        pt1 - 矢印の始点。
        pt2 - 矢印の指す先の点。
        color - 線の色。
      • rectangle

        public static void rectangle​(Mat img,
                                     Point pt1,
                                     Point pt2,
                                     Scalar color,
                                     int thickness,
                                     int lineType,
                                     int shift)
        Draws a simple, thick, or filled up-right rectangle. The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners are pt1 and pt2.
        引数:
        img - 画像。
        pt1 - 矩形の頂点。
        pt2 - pt1 の対角にある矩形の頂点。
        color - 矩形の色、またはグレースケール画像の場合は輝度。
        thickness - 矩形を構成する線の太さ。#FILLED のような負の値は、塗りつぶされた矩形を描画することを意味する。
        lineType - 線の種類。#LineTypes を参照。
        shift - 点座標の小数部のビット数。
      • rectangle

        public static void rectangle​(Mat img,
                                     Point pt1,
                                     Point pt2,
                                     Scalar color,
                                     int thickness,
                                     int lineType)
        Draws a simple, thick, or filled up-right rectangle. The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners are pt1 and pt2.
        引数:
        img - 画像。
        pt1 - 矩形の頂点。
        pt2 - pt1 の対角にある矩形の頂点。
        color - 矩形の色、またはグレースケール画像の場合は輝度。
        thickness - 矩形を構成する線の太さ。#FILLED のような負の値は、塗りつぶされた矩形を描画することを意味する。
        lineType - 線の種類。#LineTypes を参照。
      • rectangle

        public static void rectangle​(Mat img,
                                     Point pt1,
                                     Point pt2,
                                     Scalar color,
                                     int thickness)
        Draws a simple, thick, or filled up-right rectangle. The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners are pt1 and pt2.
        引数:
        img - 画像。
        pt1 - 矩形の頂点。
        pt2 - pt1 の対角にある矩形の頂点。
        color - 矩形の色、またはグレースケール画像の場合は輝度。
        thickness - 矩形を構成する線の太さ。#FILLED のような負の値は、塗りつぶされた矩形を描画することを意味する。
      • rectangle

        public static void rectangle​(Mat img,
                                     Point pt1,
                                     Point pt2,
                                     Scalar color)
        Draws a simple, thick, or filled up-right rectangle. The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners are pt1 and pt2.
        引数:
        img - 画像。
        pt1 - 矩形の頂点。
        pt2 - pt1 の対角にある矩形の頂点。
        color - 矩形の色、またはグレースケール画像の場合は輝度。塗りつぶされた矩形を描画することを意味する。
      • rectangle

        public static void rectangle​(Mat img,
                                     Rect rec,
                                     Scalar color,
                                     int thickness,
                                     int lineType,
                                     int shift)
        use rec parameter as alternative specification of the drawn rectangle: `r.tl() and r.br()-Point(1,1)` are opposite corners
        引数:
        img - 自動生成
        rec - 自動生成
        color - 自動生成
        thickness - 自動生成
        lineType - 自動生成
        shift - 自動生成
      • rectangle

        public static void rectangle​(Mat img,
                                     Rect rec,
                                     Scalar color,
                                     int thickness,
                                     int lineType)
        use rec parameter as alternative specification of the drawn rectangle: `r.tl() and r.br()-Point(1,1)` are opposite corners
        引数:
        img - 自動生成
        rec - 自動生成
        color - 自動生成
        thickness - 自動生成
        lineType - 自動生成
      • rectangle

        public static void rectangle​(Mat img,
                                     Rect rec,
                                     Scalar color,
                                     int thickness)
        use rec parameter as alternative specification of the drawn rectangle: `r.tl() and r.br()-Point(1,1)` are opposite corners
        引数:
        img - 自動生成
        rec - 自動生成
        color - 自動生成
        thickness - 自動生成
      • rectangle

        public static void rectangle​(Mat img,
                                     Rect rec,
                                     Scalar color)
        use rec parameter as alternative specification of the drawn rectangle: `r.tl() and r.br()-Point(1,1)` are opposite corners
        引数:
        img - 自動生成
        rec - 自動生成
        color - 自動生成
      • circle

        public static void circle​(Mat img,
                                  Point center,
                                  int radius,
                                  Scalar color,
                                  int thickness,
                                  int lineType,
                                  int shift)
        Draws a circle. The function cv::circle draws a simple or filled circle with a given center and radius.
        引数:
        img - 円を描画する画像。
        center - 円の中心。
        radius - 円の半径。
        color - 円の色。
        thickness - 円の輪郭線の太さ(正の値の場合)。#FILLED のような負の値は、塗りつぶされた円を描画することを意味する。
        lineType - 円の境界線の種類。#LineTypes を参照。
        shift - 中心座標および半径の値の小数部のビット数。
      • circle

        public static void circle​(Mat img,
                                  Point center,
                                  int radius,
                                  Scalar color,
                                  int thickness,
                                  int lineType)
        Draws a circle. The function cv::circle draws a simple or filled circle with a given center and radius.
        引数:
        img - 円を描画する画像。
        center - 円の中心。
        radius - 円の半径。
        color - 円の色。
        thickness - 円の輪郭線の太さ(正の値の場合)。#FILLED のような負の値は、塗りつぶされた円を描画することを意味する。
        lineType - 円の境界線の種類。#LineTypes を参照。
      • circle

        public static void circle​(Mat img,
                                  Point center,
                                  int radius,
                                  Scalar color,
                                  int thickness)
        Draws a circle. The function cv::circle draws a simple or filled circle with a given center and radius.
        引数:
        img - 円を描画する画像。
        center - 円の中心。
        radius - 円の半径。
        color - 円の色。
        thickness - 円の輪郭線の太さ(正の値の場合)。#FILLED のような負の値は、塗りつぶされた円を描画することを意味する。
      • circle

        public static void circle​(Mat img,
                                  Point center,
                                  int radius,
                                  Scalar color)
        Draws a circle. The function cv::circle draws a simple or filled circle with a given center and radius.
        引数:
        img - 円を描画する画像。
        center - 円の中心。
        radius - 円の半径。
        color - 円の色。塗りつぶされた円を描画することを意味する。
      • ellipse

        public static void ellipse​(Mat img,
                                   Point center,
                                   Size axes,
                                   double angle,
                                   double startAngle,
                                   double endAngle,
                                   Scalar color,
                                   int thickness,
                                   int lineType,
                                   int shift)
        Draws a simple or thick elliptic arc or fills an ellipse sector. The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector. The drawing code uses general parametric form. A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass startAngle=0 and endAngle=360. If startAngle is greater than endAngle, they are swapped. The figure below explains the meaning of the parameters to draw the blue arc. ![Parameters of Elliptic Arc](pics/ellipse.svg)
        引数:
        img - 画像。
        center - 楕円の中心。
        axes - 楕円の主軸サイズの半分。
        angle - 楕円の回転角度(度単位)。
        startAngle - 楕円弧の開始角度(度単位)。
        endAngle - 楕円弧の終了角度(度単位)。
        color - 楕円の色。
        thickness - 楕円弧の輪郭線の太さ(正の値の場合)。それ以外の場合は、塗りつぶされた楕円扇形を描画することを示す。
        lineType - 楕円の境界線の種類。#LineTypes を参照。
        shift - 中心座標および軸の値の小数部のビット数。
      • ellipse

        public static void ellipse​(Mat img,
                                   Point center,
                                   Size axes,
                                   double angle,
                                   double startAngle,
                                   double endAngle,
                                   Scalar color,
                                   int thickness,
                                   int lineType)
        Draws a simple or thick elliptic arc or fills an ellipse sector. The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector. The drawing code uses general parametric form. A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass startAngle=0 and endAngle=360. If startAngle is greater than endAngle, they are swapped. The figure below explains the meaning of the parameters to draw the blue arc. ![Parameters of Elliptic Arc](pics/ellipse.svg)
        引数:
        img - 画像。
        center - 楕円の中心。
        axes - 楕円の主軸サイズの半分。
        angle - 楕円の回転角度(度単位)。
        startAngle - 楕円弧の開始角度(度単位)。
        endAngle - 楕円弧の終了角度(度単位)。
        color - 楕円の色。
        thickness - 楕円弧の輪郭線の太さ(正の値の場合)。それ以外の場合は、塗りつぶされた楕円扇形を描画することを示す。
        lineType - 楕円の境界線の種類。#LineTypes を参照。
      • ellipse

        public static void ellipse​(Mat img,
                                   Point center,
                                   Size axes,
                                   double angle,
                                   double startAngle,
                                   double endAngle,
                                   Scalar color,
                                   int thickness)
        Draws a simple or thick elliptic arc or fills an ellipse sector. The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector. The drawing code uses general parametric form. A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass startAngle=0 and endAngle=360. If startAngle is greater than endAngle, they are swapped. The figure below explains the meaning of the parameters to draw the blue arc. ![Parameters of Elliptic Arc](pics/ellipse.svg)
        引数:
        img - 画像。
        center - 楕円の中心。
        axes - 楕円の主軸サイズの半分。
        angle - 楕円の回転角度(度単位)。
        startAngle - 楕円弧の開始角度(度単位)。
        endAngle - 楕円弧の終了角度(度単位)。
        color - 楕円の色。
        thickness - 楕円弧の輪郭線の太さ(正の値の場合)。それ以外の場合は、塗りつぶされた楕円扇形を描画することを示す。
      • ellipse

        public static void ellipse​(Mat img,
                                   Point center,
                                   Size axes,
                                   double angle,
                                   double startAngle,
                                   double endAngle,
                                   Scalar color)
        Draws a simple or thick elliptic arc or fills an ellipse sector. The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic arc, or a filled ellipse sector. The drawing code uses general parametric form. A piecewise-linear curve is used to approximate the elliptic arc boundary. If you need more control of the ellipse rendering, you can retrieve the curve using #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first variant of the function and want to draw the whole ellipse, not an arc, pass startAngle=0 and endAngle=360. If startAngle is greater than endAngle, they are swapped. The figure below explains the meaning of the parameters to draw the blue arc. ![Parameters of Elliptic Arc](pics/ellipse.svg)
        引数:
        img - 画像。
        center - 楕円の中心。
        axes - 楕円の主軸サイズの半分。
        angle - 楕円の回転角度(度単位)。
        startAngle - 楕円弧の開始角度(度単位)。
        endAngle - 楕円弧の終了角度(度単位)。
        color - 楕円の色。塗りつぶされた楕円扇形を描画することを示す。
      • ellipse

        public static void ellipse​(Mat img,
                                   RotatedRect box,
                                   Scalar color,
                                   int thickness,
                                   int lineType)
        引数:
        img - 画像。
        box - RotatedRect による楕円の代替表現。これは、回転矩形に内接する楕円を関数が描画することを意味する。
        color - 楕円の色。
        thickness - 楕円弧の輪郭線の太さ(正の値の場合)。それ以外の場合は、塗りつぶされた楕円扇形を描画することを示す。
        lineType - 楕円の境界線の種類。#LineTypes を参照。
      • ellipse

        public static void ellipse​(Mat img,
                                   RotatedRect box,
                                   Scalar color,
                                   int thickness)
        引数:
        img - 画像。
        box - RotatedRect による楕円の代替表現。これは、回転矩形に内接する楕円を関数が描画することを意味する。
        color - 楕円の色。
        thickness - 楕円弧の輪郭線の太さ(正の値の場合)。それ以外の場合は、塗りつぶされた楕円扇形を描画することを示す。
      • ellipse

        public static void ellipse​(Mat img,
                                   RotatedRect box,
                                   Scalar color)
        引数:
        img - 画像。
        box - RotatedRect による楕円の代替表現。これは、回転矩形に内接する楕円を関数が描画することを意味する。
        color - 楕円の色。塗りつぶされた楕円扇形を描画することを示す。
      • drawMarker

        public static void drawMarker​(Mat img,
                                      Point position,
                                      Scalar color,
                                      int markerType,
                                      int markerSize,
                                      int thickness,
                                      int line_type)
        Draws a marker on a predefined position in an image. The function cv::drawMarker draws a marker on a given position in the image. For the moment several marker types are supported, see #MarkerTypes for more information.
        引数:
        img - 画像。
        position - 十字マーカーを配置する点。
        color - 線の色。
        markerType - 使用したいマーカーの具体的な種類。#MarkerTypes を参照。
        thickness - 線の太さ。
        line_type - 線の種類。#LineTypes を参照。
        markerSize - マーカーの軸の長さ [デフォルト = 20 ピクセル]
      • drawMarker

        public static void drawMarker​(Mat img,
                                      Point position,
                                      Scalar color,
                                      int markerType,
                                      int markerSize,
                                      int thickness)
        Draws a marker on a predefined position in an image. The function cv::drawMarker draws a marker on a given position in the image. For the moment several marker types are supported, see #MarkerTypes for more information.
        引数:
        img - 画像。
        position - 十字マーカーを配置する点。
        color - 線の色。
        markerType - 使用したいマーカーの具体的な種類。#MarkerTypes を参照。
        thickness - 線の太さ。
        markerSize - マーカーの軸の長さ [デフォルト = 20 ピクセル]
      • drawMarker

        public static void drawMarker​(Mat img,
                                      Point position,
                                      Scalar color,
                                      int markerType,
                                      int markerSize)
        Draws a marker on a predefined position in an image. The function cv::drawMarker draws a marker on a given position in the image. For the moment several marker types are supported, see #MarkerTypes for more information.
        引数:
        img - 画像。
        position - 十字マーカーを配置する点。
        color - 線の色。
        markerType - 使用したいマーカーの具体的な種類。#MarkerTypes を参照。
        markerSize - マーカーの軸の長さ [デフォルト = 20 ピクセル]
      • drawMarker

        public static void drawMarker​(Mat img,
                                      Point position,
                                      Scalar color,
                                      int markerType)
        Draws a marker on a predefined position in an image. The function cv::drawMarker draws a marker on a given position in the image. For the moment several marker types are supported, see #MarkerTypes for more information.
        引数:
        img - 画像。
        position - 十字マーカーを配置する点。
        color - 線の色。
        markerType - 使用したいマーカーの具体的な種類。#MarkerTypes を参照。
      • drawMarker

        public static void drawMarker​(Mat img,
                                      Point position,
                                      Scalar color)
        Draws a marker on a predefined position in an image. The function cv::drawMarker draws a marker on a given position in the image. For the moment several marker types are supported, see #MarkerTypes for more information.
        引数:
        img - 画像。
        position - 十字マーカーを配置する点。
        color - 線の色。
      • fillConvexPoly

        public static void fillConvexPoly​(Mat img,
                                          MatOfPoint points,
                                          Scalar color,
                                          int lineType,
                                          int shift)
        Fills a convex polygon. The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the function #fillPoly . It can fill not only convex polygons but any monotonic polygon without self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line) twice at the most (though, its top-most and/or the bottom edge could be horizontal).
        引数:
        img - 画像。
        points - 多角形の頂点。
        color - 多角形の色。
        lineType - 多角形の境界線の種類。#LineTypes を参照。
        shift - 頂点座標の小数部のビット数。
      • fillConvexPoly

        public static void fillConvexPoly​(Mat img,
                                          MatOfPoint points,
                                          Scalar color,
                                          int lineType)
        Fills a convex polygon. The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the function #fillPoly . It can fill not only convex polygons but any monotonic polygon without self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line) twice at the most (though, its top-most and/or the bottom edge could be horizontal).
        引数:
        img - 画像。
        points - 多角形の頂点。
        color - 多角形の色。
        lineType - 多角形の境界線の種類。#LineTypes を参照。
      • fillConvexPoly

        public static void fillConvexPoly​(Mat img,
                                          MatOfPoint points,
                                          Scalar color)
        Fills a convex polygon. The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the function #fillPoly . It can fill not only convex polygons but any monotonic polygon without self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line) twice at the most (though, its top-most and/or the bottom edge could be horizontal).
        引数:
        img - 画像。
        points - 多角形の頂点。
        color - 多角形の色。
      • fillPoly

        public static void fillPoly​(Mat img,
                                    java.util.List<MatOfPoint> pts,
                                    Scalar color,
                                    int lineType,
                                    int shift,
                                    Point offset)
        Fills the area bounded by one or more polygons. The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill complex areas, for example, areas with holes, contours with self-intersections (some of their parts), and so forth.
        引数:
        img - 画像。
        pts - 多角形の配列。各多角形は点の配列として表現される。
        color - 多角形の色。
        lineType - 多角形の境界線の種類。#LineTypes を参照。
        shift - 頂点座標の小数部のビット数。
        offset - 輪郭の全点に対する省略可能なオフセット。
      • fillPoly

        public static void fillPoly​(Mat img,
                                    java.util.List<MatOfPoint> pts,
                                    Scalar color,
                                    int lineType,
                                    int shift)
        Fills the area bounded by one or more polygons. The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill complex areas, for example, areas with holes, contours with self-intersections (some of their parts), and so forth.
        引数:
        img - 画像。
        pts - 多角形の配列。各多角形は点の配列として表現される。
        color - 多角形の色。
        lineType - 多角形の境界線の種類。#LineTypes を参照。
        shift - 頂点座標の小数部のビット数。
      • fillPoly

        public static void fillPoly​(Mat img,
                                    java.util.List<MatOfPoint> pts,
                                    Scalar color,
                                    int lineType)
        Fills the area bounded by one or more polygons. The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill complex areas, for example, areas with holes, contours with self-intersections (some of their parts), and so forth.
        引数:
        img - 画像。
        pts - 多角形の配列。各多角形は点の配列として表現される。
        color - 多角形の色。
        lineType - 多角形の境界線の種類。#LineTypes を参照。
      • fillPoly

        public static void fillPoly​(Mat img,
                                    java.util.List<MatOfPoint> pts,
                                    Scalar color)
        Fills the area bounded by one or more polygons. The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill complex areas, for example, areas with holes, contours with self-intersections (some of their parts), and so forth.
        引数:
        img - 画像。
        pts - 多角形の配列。各多角形は点の配列として表現される。
        color - 多角形の色。
      • polylines

        public static void polylines​(Mat img,
                                     java.util.List<MatOfPoint> pts,
                                     boolean isClosed,
                                     Scalar color,
                                     int thickness,
                                     int lineType,
                                     int shift)
        Draws several polygonal curves.
        引数:
        img - 画像。
        pts - 多角形曲線の配列。
        isClosed - 描画する折れ線を閉じるかどうかを示すフラグ。閉じる場合、関数は各曲線の最後の頂点から最初の頂点へ線を描画する。
        color - 折れ線の色。
        thickness - 折れ線の辺の太さ。
        lineType - 線分の種類。#LineTypes を参照。
        shift - 頂点座標の小数部のビット数。関数 cv::polylines は1本以上の多角形曲線を描画する。
      • polylines

        public static void polylines​(Mat img,
                                     java.util.List<MatOfPoint> pts,
                                     boolean isClosed,
                                     Scalar color,
                                     int thickness,
                                     int lineType)
        Draws several polygonal curves.
        引数:
        img - 画像。
        pts - 多角形曲線の配列。
        isClosed - 描画する折れ線を閉じるかどうかを示すフラグ。閉じる場合、関数は各曲線の最後の頂点から最初の頂点へ線を描画する。
        color - 折れ線の色。
        thickness - 折れ線の辺の太さ。
        lineType - 線分の種類。#LineTypes を参照。関数 cv::polylines は1本以上の多角形曲線を描画する。
      • polylines

        public static void polylines​(Mat img,
                                     java.util.List<MatOfPoint> pts,
                                     boolean isClosed,
                                     Scalar color,
                                     int thickness)
        Draws several polygonal curves.
        引数:
        img - 画像。
        pts - 多角形曲線の配列。
        isClosed - 描画する折れ線を閉じるかどうかを示すフラグ。閉じる場合、関数は各曲線の最後の頂点から最初の頂点へ線を描画する。
        color - 折れ線の色。
        thickness - 折れ線の辺の太さ。関数 cv::polylines は1本以上の多角形曲線を描画する。
      • polylines

        public static void polylines​(Mat img,
                                     java.util.List<MatOfPoint> pts,
                                     boolean isClosed,
                                     Scalar color)
        Draws several polygonal curves.
        引数:
        img - 画像。
        pts - 多角形曲線の配列。
        isClosed - 描画する折れ線を閉じるかどうかを示すフラグ。閉じる場合、関数は各曲線の最後の頂点から最初の頂点へ線を描画する。
        color - 折れ線の色。関数 cv::polylines は1本以上の多角形曲線を描画する。
      • drawContours

        public static void drawContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        int contourIdx,
                                        Scalar color,
                                        int thickness,
                                        int lineType,
                                        Mat hierarchy,
                                        int maxLevel,
                                        Point offset)
        Draws contours outlines or filled contours. The function draws contour outlines in the image if \(\texttt{thickness} \ge 0\) or fills the area bounded by the contours if \(\texttt{thickness}<0\) . The example below shows how to retrieve connected components from the binary image and label them: : INCLUDE: snippets/imgproc_drawContours.cpp
        引数:
        image - 出力画像。
        contours - すべての入力輪郭。各輪郭は点ベクトルとして格納される。
        contourIdx - 描画する輪郭を指定する引数。負の値の場合、すべての輪郭が描画される。
        color - 輪郭の色。
        thickness - 輪郭を描画する線の太さ。負の値の場合(例: thickness=#FILLED )、輪郭の内部が塗りつぶされる。
        lineType - 線の接続性。#LineTypes を参照。
        hierarchy - 階層に関する省略可能な情報。一部の輪郭だけを描画したい場合にのみ必要(maxLevel を参照)。
        maxLevel - 描画する輪郭の最大レベル。0 の場合、指定した輪郭のみが描画される。1 の場合、その輪郭とすべてのネストされた輪郭が描画される。2 の場合、輪郭、すべてのネストされた輪郭、さらにそのネストされた輪郭、というように描画される。この引数は階層情報が利用可能な場合にのみ考慮される。
        offset - 省略可能な輪郭のシフト量。描画されるすべての輪郭を指定した \(\texttt{offset}=(dx,dy)\) だけシフトする。 覚え書き: thickness=#FILLED の場合、この関数は階層データが提供されていなくても、穴を持つ連結成分を正しく処理するように設計されている。これはすべての輪郭線を偶奇ルールでまとめて解析することで行われる。別々に取得した輪郭をまとめたコレクションを与えると、誤った結果になることがある。この問題を解決するには、輪郭のサブグループごとに #drawContours を個別に呼び出すか、contourIdx 引数を使ってコレクションを反復処理する必要がある。
      • drawContours

        public static void drawContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        int contourIdx,
                                        Scalar color,
                                        int thickness,
                                        int lineType,
                                        Mat hierarchy,
                                        int maxLevel)
        Draws contours outlines or filled contours. The function draws contour outlines in the image if \(\texttt{thickness} \ge 0\) or fills the area bounded by the contours if \(\texttt{thickness}<0\) . The example below shows how to retrieve connected components from the binary image and label them: : INCLUDE: snippets/imgproc_drawContours.cpp
        引数:
        image - 出力画像。
        contours - すべての入力輪郭。各輪郭は点ベクトルとして格納される。
        contourIdx - 描画する輪郭を指定する引数。負の値の場合、すべての輪郭が描画される。
        color - 輪郭の色。
        thickness - 輪郭を描画する線の太さ。負の値の場合(例: thickness=#FILLED )、輪郭の内部が塗りつぶされる。
        lineType - 線の接続性。#LineTypes を参照。
        hierarchy - 階層に関する省略可能な情報。一部の輪郭だけを描画したい場合にのみ必要(maxLevel を参照)。
        maxLevel - 描画する輪郭の最大レベル。0 の場合、指定した輪郭のみが描画される。1 の場合、その輪郭とすべてのネストされた輪郭が描画される。2 の場合、輪郭、すべてのネストされた輪郭、さらにそのネストされた輪郭、というように描画される。この引数は階層情報が利用可能な場合にのみ考慮される。 \(\texttt{offset}=(dx,dy)\) 。 覚え書き: thickness=#FILLED の場合、この関数は階層データが提供されていなくても、穴を持つ連結成分を正しく処理するように設計されている。これはすべての輪郭線を偶奇ルールでまとめて解析することで行われる。別々に取得した輪郭をまとめたコレクションを与えると、誤った結果になることがある。この問題を解決するには、輪郭のサブグループごとに #drawContours を個別に呼び出すか、contourIdx 引数を使ってコレクションを反復処理する必要がある。
      • drawContours

        public static void drawContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        int contourIdx,
                                        Scalar color,
                                        int thickness,
                                        int lineType,
                                        Mat hierarchy)
        Draws contours outlines or filled contours. The function draws contour outlines in the image if \(\texttt{thickness} \ge 0\) or fills the area bounded by the contours if \(\texttt{thickness}<0\) . The example below shows how to retrieve connected components from the binary image and label them: : INCLUDE: snippets/imgproc_drawContours.cpp
        引数:
        image - 出力画像。
        contours - すべての入力輪郭。各輪郭は点ベクトルとして格納される。
        contourIdx - 描画する輪郭を指定する引数。負の値の場合、すべての輪郭が描画される。
        color - 輪郭の色。
        thickness - 輪郭を描画する線の太さ。負の値の場合(例: thickness=#FILLED )、輪郭の内部が塗りつぶされる。
        lineType - 線の接続性。#LineTypes を参照。
        hierarchy - 階層に関する省略可能な情報。一部の輪郭だけを描画したい場合にのみ必要(maxLevel を参照)。1 の場合、その輪郭とすべてのネストされた輪郭が描画される。2 の場合、輪郭、すべてのネストされた輪郭、さらにそのネストされた輪郭、というように描画される。この引数は階層情報が利用可能な場合にのみ考慮される。 \(\texttt{offset}=(dx,dy)\) 。 覚え書き: thickness=#FILLED の場合、この関数は階層データが提供されていなくても、穴を持つ連結成分を正しく処理するように設計されている。これはすべての輪郭線を偶奇ルールでまとめて解析することで行われる。別々に取得した輪郭をまとめたコレクションを与えると、誤った結果になることがある。この問題を解決するには、輪郭のサブグループごとに #drawContours を個別に呼び出すか、contourIdx 引数を使ってコレクションを反復処理する必要がある。
      • drawContours

        public static void drawContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        int contourIdx,
                                        Scalar color,
                                        int thickness,
                                        int lineType)
        Draws contours outlines or filled contours. The function draws contour outlines in the image if \(\texttt{thickness} \ge 0\) or fills the area bounded by the contours if \(\texttt{thickness}<0\) . The example below shows how to retrieve connected components from the binary image and label them: : INCLUDE: snippets/imgproc_drawContours.cpp
        引数:
        image - 出力画像。
        contours - すべての入力輪郭。各輪郭は点ベクトルとして格納される。
        contourIdx - 描画する輪郭を指定する引数。負の値の場合、すべての輪郭が描画される。
        color - 輪郭の色。
        thickness - 輪郭を描画する線の太さ。負の値の場合(例: thickness=#FILLED )、輪郭の内部が塗りつぶされる。
        lineType - 線の接続性。#LineTypes を参照。一部の輪郭だけ(maxLevel を参照)。1 の場合、その輪郭とすべてのネストされた輪郭が描画される。2 の場合、輪郭、すべてのネストされた輪郭、さらにそのネストされた輪郭、というように描画される。この引数は階層情報が利用可能な場合にのみ考慮される。 \(\texttt{offset}=(dx,dy)\) 。 覚え書き: thickness=#FILLED の場合、この関数は階層データが提供されていなくても、穴を持つ連結成分を正しく処理するように設計されている。これはすべての輪郭線を偶奇ルールでまとめて解析することで行われる。別々に取得した輪郭をまとめたコレクションを与えると、誤った結果になることがある。この問題を解決するには、輪郭のサブグループごとに #drawContours を個別に呼び出すか、contourIdx 引数を使ってコレクションを反復処理する必要がある。
      • drawContours

        public static void drawContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        int contourIdx,
                                        Scalar color,
                                        int thickness)
        Draws contours outlines or filled contours. The function draws contour outlines in the image if \(\texttt{thickness} \ge 0\) or fills the area bounded by the contours if \(\texttt{thickness}<0\) . The example below shows how to retrieve connected components from the binary image and label them: : INCLUDE: snippets/imgproc_drawContours.cpp
        引数:
        image - 出力画像。
        contours - すべての入力輪郭。各輪郭は点ベクトルとして格納される。
        contourIdx - 描画する輪郭を指定する引数。負の値の場合、すべての輪郭が描画される。
        color - 輪郭の色。
        thickness - 輪郭を描画する線の太さ。負の値の場合(例: thickness=#FILLED )、輪郭の内部が塗りつぶされる。一部の輪郭だけ(maxLevel を参照)。1 の場合、その輪郭とすべてのネストされた輪郭が描画される。2 の場合、輪郭、すべてのネストされた輪郭、さらにそのネストされた輪郭、というように描画される。この引数は階層情報が利用可能な場合にのみ考慮される。 \(\texttt{offset}=(dx,dy)\) 。 覚え書き: thickness=#FILLED の場合、この関数は階層データが提供されていなくても、穴を持つ連結成分を正しく処理するように設計されている。これはすべての輪郭線を偶奇ルールでまとめて解析することで行われる。別々に取得した輪郭をまとめたコレクションを与えると、誤った結果になることがある。この問題を解決するには、輪郭のサブグループごとに #drawContours を個別に呼び出すか、contourIdx 引数を使ってコレクションを反復処理する必要がある。
      • drawContours

        public static void drawContours​(Mat image,
                                        java.util.List<MatOfPoint> contours,
                                        int contourIdx,
                                        Scalar color)
        Draws contours outlines or filled contours. The function draws contour outlines in the image if \(\texttt{thickness} \ge 0\) or fills the area bounded by the contours if \(\texttt{thickness}<0\) . The example below shows how to retrieve connected components from the binary image and label them: : INCLUDE: snippets/imgproc_drawContours.cpp
        引数:
        image - 出力画像。
        contours - すべての入力輪郭。各輪郭は点ベクトルとして格納される。
        contourIdx - 描画する輪郭を指定する引数。負の値の場合、すべての輪郭が描画される。
        color - 輪郭の色。thickness=#FILLED )、輪郭の内部が塗りつぶされる。一部の輪郭だけ(maxLevel を参照)。1 の場合、その輪郭とすべてのネストされた輪郭が描画される。2 の場合、輪郭、すべてのネストされた輪郭、さらにそのネストされた輪郭、というように描画される。この引数は階層情報が利用可能な場合にのみ考慮される。 \(\texttt{offset}=(dx,dy)\) 。 覚え書き: thickness=#FILLED の場合、この関数は階層データが提供されていなくても、穴を持つ連結成分を正しく処理するように設計されている。これはすべての輪郭線を偶奇ルールでまとめて解析することで行われる。別々に取得した輪郭をまとめたコレクションを与えると、誤った結果になることがある。この問題を解決するには、輪郭のサブグループごとに #drawContours を個別に呼び出すか、contourIdx 引数を使ってコレクションを反復処理する必要がある。
      • clipLine

        public static boolean clipLine​(Rect imgRect,
                                       Point pt1,
                                       Point pt2)
        引数:
        imgRect - 画像の矩形。
        pt1 - 線分の始点。
        pt2 - 線分の終点。
        戻り値:
        自動生成
      • ellipse2Poly

        public static void ellipse2Poly​(Point center,
                                        Size axes,
                                        int angle,
                                        int arcStart,
                                        int arcEnd,
                                        int delta,
                                        MatOfPoint pts)
        Approximates an elliptic arc with a polyline. The function ellipse2Poly computes the vertices of a polyline that approximates the specified elliptic arc. It is used by #ellipse. If arcStart is greater than arcEnd, they are swapped.
        引数:
        center - 円弧の中心。
        axes - 楕円の主軸サイズの半分。詳細は #ellipse を参照。
        angle - 楕円の回転角度(度単位)。詳細は #ellipse を参照。
        arcStart - 楕円弧の開始角度(度単位)。
        arcEnd - 楕円弧の終了角度(度単位)。
        delta - 連続する折れ線頂点間の角度。近似精度を定める。
        pts - 折れ線頂点の出力ベクトル。
      • putText

        public static void putText​(Mat img,
                                   java.lang.String text,
                                   Point org,
                                   int fontFace,
                                   double fontScale,
                                   Scalar color,
                                   int thickness,
                                   int lineType,
                                   boolean bottomLeftOrigin)
        Draws a text string. The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by question marks. See #getTextSize for a text rendering code example. The fontScale parameter is a scale factor that is multiplied by the base font size:
        • scale > 1 のとき、テキストは拡大される。
        • 0 < scale < 1 のとき、テキストは縮小される。
        • scale < 0 のとき、テキストは反転(鏡像化)される。
        引数:
        img - 画像。
        text - 描画するテキスト文字列。
        org - 画像内におけるテキスト文字列の左下隅。
        fontFace - フォントの種類。#HersheyFonts を参照。
        fontScale - フォント固有の基本サイズに乗じるフォントスケール係数。
        color - テキストの色。
        thickness - テキストの描画に使う線の太さ。
        lineType - 線の種類。#LineTypes を参照。
        bottomLeftOrigin - true の場合、画像データの原点は左下隅にある。それ以外の場合は左上隅にある。
      • putText

        public static void putText​(Mat img,
                                   java.lang.String text,
                                   Point org,
                                   int fontFace,
                                   double fontScale,
                                   Scalar color,
                                   int thickness,
                                   int lineType)
        Draws a text string. The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by question marks. See #getTextSize for a text rendering code example. The fontScale parameter is a scale factor that is multiplied by the base font size:
        • scale > 1 のとき、テキストは拡大される。
        • 0 < scale < 1 のとき、テキストは縮小される。
        • scale < 0 のとき、テキストは反転(鏡像化)される。
        引数:
        img - 画像。
        text - 描画するテキスト文字列。
        org - 画像内におけるテキスト文字列の左下隅。
        fontFace - フォントの種類。#HersheyFonts を参照。
        fontScale - フォント固有の基本サイズに乗じるフォントスケール係数。
        color - テキストの色。
        thickness - テキストの描画に使う線の太さ。
        lineType - 線の種類。#LineTypes を参照。左上隅にある。
      • putText

        public static void putText​(Mat img,
                                   java.lang.String text,
                                   Point org,
                                   int fontFace,
                                   double fontScale,
                                   Scalar color,
                                   int thickness)
        Draws a text string. The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by question marks. See #getTextSize for a text rendering code example. The fontScale parameter is a scale factor that is multiplied by the base font size:
        • scale > 1 のとき、テキストは拡大される。
        • 0 < scale < 1 のとき、テキストは縮小される。
        • scale < 0 のとき、テキストは反転(鏡像化)される。
        引数:
        img - 画像。
        text - 描画するテキスト文字列。
        org - 画像内におけるテキスト文字列の左下隅。
        fontFace - フォントの種類。#HersheyFonts を参照。
        fontScale - フォント固有の基本サイズに乗じるフォントスケール係数。
        color - テキストの色。
        thickness - テキストの描画に使う線の太さ。左上隅にある。
      • putText

        public static void putText​(Mat img,
                                   java.lang.String text,
                                   Point org,
                                   int fontFace,
                                   double fontScale,
                                   Scalar color)
        Draws a text string. The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered using the specified font are replaced by question marks. See #getTextSize for a text rendering code example. The fontScale parameter is a scale factor that is multiplied by the base font size:
        • scale > 1 のとき、テキストは拡大される。
        • 0 < scale < 1 のとき、テキストは縮小される。
        • scale < 0 のとき、テキストは反転(鏡像化)される。
        引数:
        img - 画像。
        text - 描画するテキスト文字列。
        org - 画像内におけるテキスト文字列の左下隅。
        fontFace - フォントの種類。#HersheyFonts を参照。
        fontScale - フォント固有の基本サイズに乗じるフォントスケール係数。
        color - テキストの色。左上隅にある。
      • getFontScaleFromHeight

        public static double getFontScaleFromHeight​(int fontFace,
                                                    int pixelHeight,
                                                    int thickness)
        Calculates the font-specific size to use to achieve a given height in pixels.
        引数:
        fontFace - 使用するフォント。cv::HersheyFonts を参照。
        pixelHeight - fontScale を算出する対象のピクセル高さ
        thickness - テキストの描画に使う線の太さ。詳細は putText を参照。
        戻り値:
        cv::putText で使用する fontSize 関連項目: cv::putText
      • getFontScaleFromHeight

        public static double getFontScaleFromHeight​(int fontFace,
                                                    int pixelHeight)
        Calculates the font-specific size to use to achieve a given height in pixels.
        引数:
        fontFace - 使用するフォント。cv::HersheyFonts を参照。
        pixelHeight - fontScale を算出する対象のピクセル高さ
        戻り値:
        cv::putText で使用する fontSize 関連項目: cv::putText
      • HoughLinesWithAccumulator

        public static void HoughLinesWithAccumulator​(Mat image,
                                                     Mat lines,
                                                     double rho,
                                                     double theta,
                                                     int threshold,
                                                     double srn,
                                                     double stn,
                                                     double min_theta,
                                                     double max_theta,
                                                     boolean use_edgeval)
        Finds lines in a binary image using the standard Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughLines
        引数:
        image - 自動生成
        lines - 自動生成
        rho - 自動生成
        theta - 自動生成
        threshold - 自動生成
        srn - 自動生成
        stn - 自動生成
        min_theta - 自動生成
        max_theta - 自動生成
        use_edgeval - 自動生成
      • HoughLinesWithAccumulator

        public static void HoughLinesWithAccumulator​(Mat image,
                                                     Mat lines,
                                                     double rho,
                                                     double theta,
                                                     int threshold,
                                                     double srn,
                                                     double stn,
                                                     double min_theta,
                                                     double max_theta)
        Finds lines in a binary image using the standard Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughLines
        引数:
        image - 自動生成
        lines - 自動生成
        rho - 自動生成
        theta - 自動生成
        threshold - 自動生成
        srn - 自動生成
        stn - 自動生成
        min_theta - 自動生成
        max_theta - 自動生成
      • HoughLinesWithAccumulator

        public static void HoughLinesWithAccumulator​(Mat image,
                                                     Mat lines,
                                                     double rho,
                                                     double theta,
                                                     int threshold,
                                                     double srn,
                                                     double stn,
                                                     double min_theta)
        Finds lines in a binary image using the standard Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughLines
        引数:
        image - 自動生成
        lines - 自動生成
        rho - 自動生成
        theta - 自動生成
        threshold - 自動生成
        srn - 自動生成
        stn - 自動生成
        min_theta - 自動生成
      • HoughLinesWithAccumulator

        public static void HoughLinesWithAccumulator​(Mat image,
                                                     Mat lines,
                                                     double rho,
                                                     double theta,
                                                     int threshold,
                                                     double srn,
                                                     double stn)
        Finds lines in a binary image using the standard Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughLines
        引数:
        image - 自動生成
        lines - 自動生成
        rho - 自動生成
        theta - 自動生成
        threshold - 自動生成
        srn - 自動生成
        stn - 自動生成
      • HoughLinesWithAccumulator

        public static void HoughLinesWithAccumulator​(Mat image,
                                                     Mat lines,
                                                     double rho,
                                                     double theta,
                                                     int threshold,
                                                     double srn)
        Finds lines in a binary image using the standard Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughLines
        引数:
        image - 自動生成
        lines - 自動生成
        rho - 自動生成
        theta - 自動生成
        threshold - 自動生成
        srn - 自動生成
      • HoughLinesWithAccumulator

        public static void HoughLinesWithAccumulator​(Mat image,
                                                     Mat lines,
                                                     double rho,
                                                     double theta,
                                                     int threshold)
        Finds lines in a binary image using the standard Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughLines
        引数:
        image - 自動生成
        lines - 自動生成
        rho - 自動生成
        theta - 自動生成
        threshold - 自動生成
      • HoughCirclesWithAccumulator

        public static void HoughCirclesWithAccumulator​(Mat image,
                                                       Mat circles,
                                                       int method,
                                                       double dp,
                                                       double minDist,
                                                       double param1,
                                                       double param2,
                                                       int minRadius,
                                                       int maxRadius)
        Finds circles in a grayscale image using the Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughCircles
        引数:
        image - 自動生成
        circles - 自動生成
        method - 自動生成
        dp - 自動生成
        minDist - 自動生成
        param1 - 自動生成
        param2 - 自動生成
        minRadius - 自動生成
        maxRadius - 自動生成
      • HoughCirclesWithAccumulator

        public static void HoughCirclesWithAccumulator​(Mat image,
                                                       Mat circles,
                                                       int method,
                                                       double dp,
                                                       double minDist,
                                                       double param1,
                                                       double param2,
                                                       int minRadius)
        Finds circles in a grayscale image using the Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughCircles
        引数:
        image - 自動生成
        circles - 自動生成
        method - 自動生成
        dp - 自動生成
        minDist - 自動生成
        param1 - 自動生成
        param2 - 自動生成
        minRadius - 自動生成
      • HoughCirclesWithAccumulator

        public static void HoughCirclesWithAccumulator​(Mat image,
                                                       Mat circles,
                                                       int method,
                                                       double dp,
                                                       double minDist,
                                                       double param1,
                                                       double param2)
        Finds circles in a grayscale image using the Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughCircles
        引数:
        image - 自動生成
        circles - 自動生成
        method - 自動生成
        dp - 自動生成
        minDist - 自動生成
        param1 - 自動生成
        param2 - 自動生成
      • HoughCirclesWithAccumulator

        public static void HoughCirclesWithAccumulator​(Mat image,
                                                       Mat circles,
                                                       int method,
                                                       double dp,
                                                       double minDist,
                                                       double param1)
        Finds circles in a grayscale image using the Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughCircles
        引数:
        image - 自動生成
        circles - 自動生成
        method - 自動生成
        dp - 自動生成
        minDist - 自動生成
        param1 - 自動生成
      • HoughCirclesWithAccumulator

        public static void HoughCirclesWithAccumulator​(Mat image,
                                                       Mat circles,
                                                       int method,
                                                       double dp,
                                                       double minDist)
        Finds circles in a grayscale image using the Hough transform and get accumulator. 覚え書き: This function is for bindings use only. Use original function in C++ code SEE: HoughCircles
        引数:
        image - 自動生成
        circles - 自動生成
        method - 自動生成
        dp - 自動生成
        minDist - 自動生成
      • getTextSize

        public static Size getTextSize​(java.lang.String text,
                                       int fontFace,
                                       double fontScale,
                                       int thickness,
                                       int[] baseLine)