🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.ml
クラス EM
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.ml.StatModel
-
- org.opencv.ml.EM
public class EM extends StatModel
このクラスはEM (Expectation Maximization) アルゴリズムを実装する。参照: REF: ml_intro_em
-
-
フィールドの要約
フィールド Modifier and Type Field Description static intCOV_MAT_DEFAULTstatic intCOV_MAT_DIAGONALstatic intCOV_MAT_GENERICstatic intCOV_MAT_SPHERICALstatic intDEFAULT_MAX_ITERSstatic intDEFAULT_NCLUSTERSstatic intSTART_AUTO_STEPstatic intSTART_E_STEPstatic intSTART_M_STEP-
クラス org.opencv.ml.StatModel から継承されたフィールド
COMPRESSED_INPUT, PREPROCESSED_INPUT, RAW_OUTPUT, UPDATE_MODEL
-
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedEM​(long addr)
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static EM__fromPtr__​(long addr)static EMcreate()Creates empty %EM model.intgetClustersNumber()SEE: setClustersNumberintgetCovarianceMatrixType()SEE: setCovarianceMatrixTypevoidgetCovs​(java.util.List<Mat> covs)Returns covariation matrices Returns vector of covariation matrices.MatgetMeans()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.TermCriteriagetTermCriteria()SEE: setTermCriteriaMatgetWeights()Returns weights of the mixtures Returns vector with the number of elements equal to the number of mixtures.static EMload​(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 EMload​(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.floatpredict​(Mat samples)Returns posterior probabilities for the provided samplesfloatpredict​(Mat samples, Mat results)Returns posterior probabilities for the provided samplesfloatpredict​(Mat samples, Mat results, int flags)Returns posterior probabilities for the provided samplesdouble[]predict2​(Mat sample, Mat probs)Returns a likelihood logarithm value and an index of the most probable mixture component for the given sample.voidsetClustersNumber​(int val)getClustersNumber SEE: getClustersNumbervoidsetCovarianceMatrixType​(int val)getCovarianceMatrixType SEE: getCovarianceMatrixTypevoidsetTermCriteria​(TermCriteria val)getTermCriteria SEE: getTermCriteriabooleantrainE​(Mat samples, Mat means0)Estimate the Gaussian mixture parameters from a samples set.booleantrainE​(Mat samples, Mat means0, Mat covs0)Estimate the Gaussian mixture parameters from a samples set.booleantrainE​(Mat samples, Mat means0, Mat covs0, Mat weights0)Estimate the Gaussian mixture parameters from a samples set.booleantrainE​(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods)Estimate the Gaussian mixture parameters from a samples set.booleantrainE​(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels)Estimate the Gaussian mixture parameters from a samples set.booleantrainE​(Mat samples, Mat means0, Mat covs0, Mat weights0, Mat logLikelihoods, Mat labels, Mat probs)Estimate the Gaussian mixture parameters from a samples set.booleantrainEM​(Mat samples)Estimate the Gaussian mixture parameters from a samples set.booleantrainEM​(Mat samples, Mat logLikelihoods)Estimate the Gaussian mixture parameters from a samples set.booleantrainEM​(Mat samples, Mat logLikelihoods, Mat labels)Estimate the Gaussian mixture parameters from a samples set.booleantrainEM​(Mat samples, Mat logLikelihoods, Mat labels, Mat probs)Estimate the Gaussian mixture parameters from a samples set.booleantrainM​(Mat samples, Mat probs0)Estimate the Gaussian mixture parameters from a samples set.booleantrainM​(Mat samples, Mat probs0, Mat logLikelihoods)Estimate the Gaussian mixture parameters from a samples set.booleantrainM​(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels)Estimate the Gaussian mixture parameters from a samples set.booleantrainM​(Mat samples, Mat probs0, Mat logLikelihoods, Mat labels, Mat probs)Estimate the Gaussian mixture parameters from a samples set.-
クラス org.opencv.ml.StatModel から継承されたメソッド
calcError, empty, getVarCount, isClassifier, isTrained, train, train, train
-
クラス org.opencv.core.Algorithm から継承されたメソッド
clear, getDefaultName, getNativeObjAddr, save
-
-
-
-
フィールドの詳細
-
DEFAULT_NCLUSTERS
public static final int DEFAULT_NCLUSTERS
- 関連項目:
- 定数フィールド値
-
DEFAULT_MAX_ITERS
public static final int DEFAULT_MAX_ITERS
- 関連項目:
- 定数フィールド値
-
START_E_STEP
public static final int START_E_STEP
- 関連項目:
- 定数フィールド値
-
START_M_STEP
public static final int START_M_STEP
- 関連項目:
- 定数フィールド値
-
START_AUTO_STEP
public static final int START_AUTO_STEP
- 関連項目:
- 定数フィールド値
-
COV_MAT_SPHERICAL
public static final int COV_MAT_SPHERICAL
- 関連項目:
- 定数フィールド値
-
COV_MAT_DIAGONAL
public static final int COV_MAT_DIAGONAL
- 関連項目:
- 定数フィールド値
-
COV_MAT_GENERIC
public static final int COV_MAT_GENERIC
- 関連項目:
- 定数フィールド値
-
COV_MAT_DEFAULT
public static final int COV_MAT_DEFAULT
- 関連項目:
- 定数フィールド値
-
-
メソッドの詳細
-
__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
-
predict
public float predict​(Mat samples, Mat results)
Returns posterior probabilities for the provided samples
-
predict
public float predict​(Mat samples)
Returns posterior probabilities for the provided 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 へのパス- 戻り値:
- 自動生成
-
-