I get the following errors from Logcat when I'm trying FlannBased matching. The descriptors I give to the matcher are FREAK descriptors. Do they not match or something? I searched for the error, but it seems to be a bug?? Is it fixed in 2.4.5 ?
05-01 17:48:14.975: E/cv::error()(4060): OpenCV Error: Unsupported format or combination of formats (type=0
05-01 17:48:14.975: E/cv::error()(4060): ) in void cv::flann::buildIndex_(void*&, const cv::Mat&, const cv::flann::IndexParams&, const Distance&) [with Distance = cvflann::L2<float>, IndexType = cvflann::Index<cvflann::L2<float> >], file /home/reports/ci/slave/50-SDK/opencv/modules/flann/src/miniflann.cpp, line 315
05-01 17:48:14.980: D/AndroidRuntime(4060): Shutting down VM
05-01 17:48:14.980: W/dalvikvm(4060): threadid=1: thread exiting with uncaught exception (group=0x4201c2a0)
05-01 17:48:14.990: E/AndroidRuntime(4060): FATAL EXCEPTION: main
05-01 17:48:14.990: E/AndroidRuntime(4060): CvException [org.opencv.core.CvException: /home/reports/ci/slave/50-SDK/opencv/modules/flann/src/miniflann.cpp:315: error: (-210) type=0
05-01 17:48:14.990: E/AndroidRuntime(4060): in function void cv::flann::buildIndex_(void*&, const cv::Mat&, const cv::flann::IndexParams&, const Distance&) [with Distance = cvflann::L2<float>, IndexType = cvflann::Index<cvflann::L2<float> >]
05-01 17:48:14.990: E/AndroidRuntime(4060): ]
The code is:
MatOfDMatch matches = new MatOfDMatch();
matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED);
matcher.match(descriptors,descriptors1,matches);
MatOfDMatch goedematches = new MatOfDMatch();
double max_dist = 0;
double min_dist = 100;
//if (descriptors.cols() == descriptors1.cols())
//{
for( int i = 0; i < descriptors.rows(); i++ )
{ double dist = matches.toArray()[i].distance;
if( dist < min_dist ) min_dist = dist;
if( dist > max_dist ) max_dist = dist;
}
// should only draw good matches
for( int i = 0; i < descriptors.rows(); i++ )
{ MatOfDMatch temp = new MatOfDMatch();
if( matches.toArray()[i].distance < 3*min_dist )
{ temp.fromArray(matches.toArray()[i]);
goedematches.push_back(temp);
}
// }
}
Log.d("LOG!", "Number of good matches= " + goedematches.size());