【OpenCV】报错cv::flann::buildIndex_

FlannBasedMatcher报错

OpenCV(4.0.0-pre) e:\opencv\opencv\modules\flann\src\miniflann.cpp:315: error: (-210:Unsupported format or combination of formats) in function 'cv::flann::buildIndex_'
> type=0

使用opencv中FlannBasedMatcher必须把描述符转成32 CV_32F

if(
descriptors_1.type()!=CV_32F) {
    descriptors_1.convertTo(descriptors_1, CV_32F);
}

if(descriptors_2.type()!=CV_32F) {
    descriptors_2.convertTo(descriptors_2, CV_32F);
}

你可能感兴趣的:(数字图像处理)