lio*_*ing 5 opencv sift multilabel-classification
我已经阅读了很多关于在获取图像的筛选特征后实现词袋的文章,但我仍然很困惑接下来要做什么。我具体做什么?
非常感谢您的指导。
这是我到目前为止的代码。
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)
小智 5
训练词袋系统如下:
至此,训练完成,您可以开始测试如下:
如您所见,使用 SIFT 没有任何限制。您可以尝试不同的特征提取器和描述符。