相关疑难解决方法(0)

如何在opencv中对词袋使用SIFT特征?

我已经阅读了很多关于在获取图像的筛选特征后实现词袋的文章,但我仍然很困惑接下来要做什么。我具体做什么?

非常感谢您的指导。

这是我到目前为止的代码。

cv::Mat mat_img = cropped.clone();
Mat grayForML;
cvtColor(mat_img, grayForML, CV_BGR2GRAY);
IplImage grayImageForML = grayForML.operator IplImage();


//create another copy of iplGray
IplImage *input = cvCloneImage(&grayImageForML);
Mat matInput = cvarrToMat(input);
//  Mat matInput = copy_gray.clone();
cv::SiftFeatureDetector detector;
std::vector<cv::KeyPoint> keyPoints;
detector.detect(input, keyPoints);
//add results to image and save.
cv::Mat output;
cv::drawKeypoints(input, keyPoints, output);    //SIFT OUTPUT RESULT


//resize and display
cv::Mat output_reduced;
cv::resize(output, output_reduced, cv::Size2i(output.cols / 2, output.rows / 2));


imshow("SIFT result", output_reduced);
Run Code Online (Sandbox Code Playgroud)

opencv sift multilabel-classification

5
推荐指数
1
解决办法
3337
查看次数

标签 统计

multilabel-classification ×1

opencv ×1

sift ×1