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

クラス EM


  • public class EM extends StatModel
    このクラスはEM (Expectation Maximization) アルゴリズムを実装する。参照: REF: ml_intro_em
    • コンストラクタの要約

      コンストラクタ
      Modifier Constructor Description
      protected EM​(long addr)  
    • メソッドの要約

      すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド
      Modifier and Type Method Description
      static EM __fromPtr__​(long addr)  
      static EM create()
      Creates empty %EM model.
      int getClustersNumber()
      SEE: setClustersNumber
      int getCovarianceMatrixType()
      SEE: setCovarianceMatrixType
      void getCovs​(java.util.List<Mat> covs)
      Returns covariation matrices Returns vector of covariation matrices.
      Mat getMeans()
      Returns the cluster centers (means of the Gaussian mixture) Returns matrix with the number of rows equal to the number of mixtures and number of columns equal to the space dimensionality.
      TermCriteria getTermCriteria()
      SEE: setTermCriteria
      Mat getWeights()
      Returns weights of the mixtures Returns vector with the number of elements equal to the number of mixtures.
      static EM load​(java.lang.String filepath)
      Loads and creates a serialized EM from a file Use EM::save to serialize and store an EM to disk.
      static EM load​(java.lang.String filepath, java.lang.String nodeName)
      Loads and creates a serialized EM from a file Use EM::save to serialize and store an EM to disk.
      float predict​(Mat samples)
      Returns posterior probabilities for the provided samples
      float predict​(Mat samples, Mat results)
      Returns posterior probabilities for the provided samples
      float predict​(Mat samples, Mat results, int flags)
      Returns posterior probabilities for the provided samples
      double[] predict2​(Mat sample, Mat probs)
      Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample.
      void setClustersNumber​(int val)
      getClustersNumber SEE: getClustersNumber
      void setCovarianceMatrixType​(int val)
      getCovarianceMatrixType SEE: getCovarianceMatrixType
      void setTermCriteria​(TermCriteria val)
      getTermCriteria SEE: getTermCriteria
      boolean trainE​(Mat samples, Mat means0)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainE​(Mat samples, Mat means0, Mat covs0)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainE​(Mat samples, Mat means0, Mat covs0, Mat weights0)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainE​(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainE​(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainE​(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels, Mat probs)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainEM​(Mat samples)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainEM​(Mat samples, Mat logLikelihoods)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainEM​(Mat samples, Mat logLikelihoods, Mat labels)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainEM​(Mat samples, Mat logLikelihoods, Mat labels, Mat probs)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainM​(Mat samples, Mat probs0)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainM​(Mat samples, Mat probs0, Mat logLikelihoods)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainM​(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels)
      Estimate the Gaussian mixture parameters from a samples set.
      boolean trainM​(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels, Mat probs)
      Estimate the Gaussian mixture parameters from a samples set.
      • クラス java.lang.Object から継承したメソッド

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • コンストラクタの詳細

      • EM

        protected EM​(long addr)
    • メソッドの詳細

      • __fromPtr__

        public static EM __fromPtr__​(long addr)
      • getClustersNumber

        public int getClustersNumber()
        SEE: setClustersNumber
        戻り値:
        自動生成
      • setClustersNumber

        public void setClustersNumber​(int val)
        getClustersNumber SEE: getClustersNumber
        引数:
        val - 自動生成
      • getCovarianceMatrixType

        public int getCovarianceMatrixType()
        SEE: setCovarianceMatrixType
        戻り値:
        自動生成
      • setCovarianceMatrixType

        public void setCovarianceMatrixType​(int val)
        getCovarianceMatrixType SEE: getCovarianceMatrixType
        引数:
        val - 自動生成
      • getTermCriteria

        public TermCriteria getTermCriteria()
        SEE: setTermCriteria
        戻り値:
        自動生成
      • setTermCriteria

        public void setTermCriteria​(TermCriteria val)
        getTermCriteria SEE: getTermCriteria
        引数:
        val - 自動生成
      • getWeights

        public Mat getWeights()
        Returns weights of the mixtures Returns vector with the number of elements equal to the number of mixtures.
        戻り値:
        自動生成
      • getMeans

        public Mat getMeans()
        Returns the cluster centers (means of the Gaussian mixture) Returns matrix with the number of rows equal to the number of mixtures and number of columns equal to the space dimensionality.
        戻り値:
        自動生成
      • getCovs

        public void getCovs​(java.util.List<Mat> covs)
        Returns covariation matrices Returns vector of covariation matrices. Number of matrices is the number of gaussian mixtures, each matrix is a square floating-point matrix NxN, where N is the space dimensionality.
        引数:
        covs - 自動生成
      • predict

        public float predict​(Mat samples,
                             Mat results,
                             int flags)
        Returns posterior probabilities for the provided samples
        オーバーライド:
        クラス StatModel 内の predict
        引数:
        samples - 入力サンプル。浮動小数点型の行列。
        results - 省略可能な出力。結果を格納する \( nSamples \times nClusters\) 行列。入力の各サンプルに対する事後確率を含む。
        flags - この引数は無視される。
        戻り値:
        自動生成
      • predict

        public float predict​(Mat samples,
                             Mat results)
        Returns posterior probabilities for the provided samples
        オーバーライド:
        クラス StatModel 内の predict
        引数:
        samples - 入力サンプル。浮動小数点型の行列。
        results - 省略可能な出力。結果を格納する \( nSamples \times nClusters\) 行列。入力の各サンプルに対する事後確率を含む。
        戻り値:
        自動生成
      • predict

        public float predict​(Mat samples)
        Returns posterior probabilities for the provided samples
        オーバーライド:
        クラス StatModel 内の predict
        引数:
        samples - 入力サンプル。浮動小数点型の行列。入力の各サンプルに対する事後確率。
        戻り値:
        自動生成
      • predict2

        public double[] predict2​(Mat sample,
                                 Mat probs)
        Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample.
        引数:
        sample - 分類対象のサンプル。\(1 \times dims\) または \(dims \times 1\) サイズのシングルチャンネル行列でなければならない。
        probs - 省略可能な出力行列。与えられたサンプルに対する各コンポーネントの事後確率を含む。\(1 \times nclusters\) サイズで CV_64FC1 型である。このメソッドは2要素の double ベクトルを返す。0番目の要素はサンプルの尤度の対数値である。1番目の要素は与えられたサンプルに対して最も確率の高い混合コンポーネントのインデックスである。
        戻り値:
        自動生成
      • trainEM

        public boolean trainEM​(Mat samples,
                               Mat logLikelihoods,
                               Mat labels,
                               Mat probs)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. Initial values of the model parameters will be estimated by the k-means algorithm. Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take responses (class labels or function values) as input. Instead, it computes the *Maximum Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the parameters inside the structure: \(p_{i,k}\) in probs, \(a_k\) in means , \(S_k\) in covs[k], \(\pi_k\) in weights , and optionally computes the output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). The trained model can be used further for prediction, just like any other classifier. The trained model is similar to the NormalBayesClassifier.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。
        labels - 各サンプルに対する省略可能な出力「クラスラベル」: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。
        probs - 省略可能な出力行列。各サンプルに対する各ガウス混合コンポーネントの事後確率を含む。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainEM

        public boolean trainEM​(Mat samples,
                               Mat logLikelihoods,
                               Mat labels)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. Initial values of the model parameters will be estimated by the k-means algorithm. Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take responses (class labels or function values) as input. Instead, it computes the *Maximum Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the parameters inside the structure: \(p_{i,k}\) in probs, \(a_k\) in means , \(S_k\) in covs[k], \(\pi_k\) in weights , and optionally computes the output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). The trained model can be used further for prediction, just like any other classifier. The trained model is similar to the NormalBayesClassifier.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。
        labels - 各サンプルに対する省略可能な出力「クラスラベル」: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainEM

        public boolean trainEM​(Mat samples,
                               Mat logLikelihoods)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. Initial values of the model parameters will be estimated by the k-means algorithm. Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take responses (class labels or function values) as input. Instead, it computes the *Maximum Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the parameters inside the structure: \(p_{i,k}\) in probs, \(a_k\) in means , \(S_k\) in covs[k], \(\pi_k\) in weights , and optionally computes the output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). The trained model can be used further for prediction, just like any other classifier. The trained model is similar to the NormalBayesClassifier.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainEM

        public boolean trainEM​(Mat samples)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. Initial values of the model parameters will be estimated by the k-means algorithm. Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take responses (class labels or function values) as input. Instead, it computes the *Maximum Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the parameters inside the structure: \(p_{i,k}\) in probs, \(a_k\) in means , \(S_k\) in covs[k], \(\pi_k\) in weights , and optionally computes the output "class label" for each sample: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\) (indices of the most probable mixture component for each sample). The trained model can be used further for prediction, just like any other classifier. The trained model is similar to the NormalBayesClassifier.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。各サンプル。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainE

        public boolean trainE​(Mat samples,
                              Mat means0,
                              Mat covs0,
                              Mat weights0,
                              Mat logLikelihoods,
                              Mat labels,
                              Mat probs)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        means0 - 混合コンポーネントの初期平均 \(a_k\)。\(nclusters \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        covs0 - 混合コンポーネントの初期共分散行列 \(S_k\) のベクトル。各共分散行列は \(dims \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        weights0 - 混合コンポーネントの初期重み \(\pi_k\)。\(1 \times nclusters\) または \(nclusters \times 1\) サイズのシングルチャンネル浮動小数点型行列でなければならない。
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。
        labels - 各サンプルに対する省略可能な出力「クラスラベル」: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。
        probs - 省略可能な出力行列。各サンプルに対する各ガウス混合コンポーネントの事後確率を含む。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainE

        public boolean trainE​(Mat samples,
                              Mat means0,
                              Mat covs0,
                              Mat weights0,
                              Mat logLikelihoods,
                              Mat labels)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        means0 - 混合コンポーネントの初期平均 \(a_k\)。\(nclusters \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        covs0 - 混合コンポーネントの初期共分散行列 \(S_k\) のベクトル。各共分散行列は \(dims \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        weights0 - 混合コンポーネントの初期重み \(\pi_k\)。\(1 \times nclusters\) または \(nclusters \times 1\) サイズのシングルチャンネル浮動小数点型行列でなければならない。
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。
        labels - 各サンプルに対する省略可能な出力「クラスラベル」: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainE

        public boolean trainE​(Mat samples,
                              Mat means0,
                              Mat covs0,
                              Mat weights0,
                              Mat logLikelihoods)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        means0 - 混合コンポーネントの初期平均 \(a_k\)。\(nclusters \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        covs0 - 混合コンポーネントの初期共分散行列 \(S_k\) のベクトル。各共分散行列は \(dims \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        weights0 - 混合コンポーネントの初期重み \(\pi_k\)。\(1 \times nclusters\) または \(nclusters \times 1\) サイズのシングルチャンネル浮動小数点型行列でなければならない。
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainE

        public boolean trainE​(Mat samples,
                              Mat means0,
                              Mat covs0,
                              Mat weights0)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        means0 - 混合コンポーネントの初期平均 \(a_k\)。\(nclusters \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        covs0 - 混合コンポーネントの初期共分散行列 \(S_k\) のベクトル。各共分散行列は \(dims \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        weights0 - 混合コンポーネントの初期重み \(\pi_k\)。\(1 \times nclusters\) または \(nclusters \times 1\) サイズのシングルチャンネル浮動小数点型行列でなければならない。各サンプル。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainE

        public boolean trainE​(Mat samples,
                              Mat means0,
                              Mat covs0)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        means0 - 混合コンポーネントの初期平均 \(a_k\)。\(nclusters \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        covs0 - 混合コンポーネントの初期共分散行列 \(S_k\) のベクトル。各共分散行列は \(dims \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。\(1 \times nclusters\) または \(nclusters \times 1\) サイズの浮動小数点型行列。各サンプル。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainE

        public boolean trainE​(Mat samples,
                              Mat means0)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Expectation step. You need to provide initial means \(a_k\) of mixture components. Optionally you can pass initial weights \(\pi_k\) and covariance matrices \(S_k\) of mixture components.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        means0 - 混合コンポーネントの初期平均 \(a_k\)。\(nclusters \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。共分散行列は \(dims \times dims\) サイズのシングルチャンネル行列である。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。\(1 \times nclusters\) または \(nclusters \times 1\) サイズの浮動小数点型行列。各サンプル。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainM

        public boolean trainM​(Mat samples,
                              Mat probs0,
                              Mat logLikelihoods,
                              Mat labels,
                              Mat probs)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Maximization step. You need to provide initial probabilities \(p_{i,k}\) to use this option.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        probs0 - 確率
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。
        labels - 各サンプルに対する省略可能な出力「クラスラベル」: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。
        probs - 省略可能な出力行列。各サンプルに対する各ガウス混合コンポーネントの事後確率を含む。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainM

        public boolean trainM​(Mat samples,
                              Mat probs0,
                              Mat logLikelihoods,
                              Mat labels)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Maximization step. You need to provide initial probabilities \(p_{i,k}\) to use this option.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        probs0 - 確率
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。
        labels - 各サンプルに対する省略可能な出力「クラスラベル」: \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainM

        public boolean trainM​(Mat samples,
                              Mat probs0,
                              Mat logLikelihoods)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Maximization step. You need to provide initial probabilities \(p_{i,k}\) to use this option.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        probs0 - 確率
        logLikelihoods - 省略可能な出力行列。各サンプルに対する尤度の対数値を含む。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • trainM

        public boolean trainM​(Mat samples,
                              Mat probs0)
        Estimate the Gaussian mixture parameters from a samples set. This variation starts with Maximization step. You need to provide initial probabilities \(p_{i,k}\) to use this option.
        引数:
        samples - ガウス混合モデルを推定するためのサンプル。シングルチャンネル行列で、各行が1つのサンプルである。行列が CV_64F 型でない場合、以降の計算のために内部でその型の行列に変換される。
        probs0 - 確率。各サンプル。\(nsamples \times 1\) サイズで CV_64FC1 型である。 \(\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\)(各サンプルに対して最も確率の高い混合コンポーネントのインデックス)。\(nsamples \times 1\) サイズで CV_32SC1 型である。各サンプルに対する混合コンポーネント。\(nsamples \times nclusters\) サイズで CV_64FC1 型である。
        戻り値:
        自動生成
      • create

        public static EM create()
        Creates empty %EM model. The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you can use one of the EM::train\* methods or load it from file using Algorithm::load<EM>(filename).
        戻り値:
        自動生成
      • load

        public static EM load​(java.lang.String filepath,
                              java.lang.String nodeName)
        Loads and creates a serialized EM from a file Use EM::save to serialize and store an EM to disk. Load the EM from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
        引数:
        filepath - シリアライズされた EM へのパス
        nodeName - 分類器を含むノードの名前
        戻り値:
        自動生成
      • load

        public static EM load​(java.lang.String filepath)
        Loads and creates a serialized EM from a file Use EM::save to serialize and store an EM to disk. Load the EM from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier
        引数:
        filepath - シリアライズされた EM へのパス
        戻り値:
        自動生成