0

opencvでflannのLSH実装を使用しようとしています:

const int mySizes[1]={100};
cv::Mat descriptors1 = cv::Mat::zeros(1,mySizes,CV_32F);
cv::Mat descriptors2 = cv::Mat::zeros(1,mySizes,CV_32F);

cv::Ptr<cv::DescriptorMatcher> matcher_;
matcher_ = new cv::FlannBasedMatcher(new cv::flann::LshIndexParams(20,10,2));
std::vector<cv::DMatch> matches;
matcher_->match(descriptors1, descriptors2, matches);

std::cout << matches[0].distance << std::endl;

descriptors1より正確には、 とdescriptors2を使用して LSH 距離を取得したいと考えていmatches[0].distanceます。

しかし、このコードを実行すると、次のようになります。

OpenCV Error: Unsupported format or combination of formats (type=5
) in buildIndex_, file /home/lpuglia/repository/opencv/modules/flann/src/miniflann.cpp, line 315
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/lpuglia/repository/opencv/modules/flann/src/miniflann.cpp:315: error: (-210) type=5
 in function buildIndex_

コードは非常に単純ですが、何が間違っていますか?

4

1 に答える 1