LoginSignup
5
6

More than 5 years have passed since last update.

cv::flann:hierachicalClusteringの使い方について

Last updated at Posted at 2014-07-15

Kmeans法だと初期クラスタ数を指定しないといけないところを、初期クラスタを自動で推定してくれる?hierarchicalClusteringの使い方メモ

cv::Mat1f originMat; ←元となる画像から生成したMat
cv::Mat1f centers(cv::Size(originMat.cols, originMat.rows), CV_32FC1);
cvflann::KMeansIndexParams k_params(10, 500,cvflann::FLANN_CENTERS_KMEANSPP,0.2);
int count = cv::flann::hierarchicalClustering<cv::flann::L2<float>>(originMat,centers,k_params);

これで、originMat内のクラスタ数がcountに代入される。

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6