cvl-robot's diary

研究ノート メモメモ https://github.com/dotchang/

CMT(Consensus-based Matching and Tracking of Keypoints)のc++版を動かしてみる

kivantium君の紹介しているこのトラッキングアルゴリズムkivantium.hateblo.jp
がお手軽そうだったので、試してみました。

彼はPython使っているので、c++版を試してみます。github.com

普通にcmakeしてopencvをリンクしてやれば動きます。

以下、略。

動きました。
f:id:cvl-robot:20150414213307g:plain

回転にとても弱いのは何故だろう?
あとでopencv3.0-betaのAKAZEに変えてみますかね。

//
void CMT::initialise(cv::Mat im_gray0, cv::Point2f topleft, cv::Point2f bottomright)
{
・・・

cv::Ptr akaze = cv::AKAZE::create();
//detector->detect(im_gray0, keypoints);
akaze->detect(im_gray0, keypoints);

・・・

//descriptorExtractor->compute(im_gray0, selected_keypoints, selectedFeatures);
akaze->compute(im_gray0, selected_keypoints, selectedFeatures);

・・・

//descriptorExtractor->compute(im_gray0, background_keypoints, background_features);
akaze->compute(im_gray0, background_keypoints, background_features);

・・・
}

・・・

void CMT::processFrame(cv::Mat im_gray)
{

・・・

cv::Ptr akaze = cv::AKAZE::create();

・・・

//detector->detect(im_gray, keypoints);
akaze->detect(im_gray, keypoints);
//descriptorExtractor->compute(im_gray, keypoints, features);
akaze->compute(im_gray, keypoints, features);

・・・

}

あんまり結果は変わらない。CMTのパラメータ次第かな。