Macos ‘;筛选&x2019;不是‘;cv’; 我尝试使用OpenCV的SIFT特征检测器在C++上使用Mac,并且我一直在获得以下错误: siftTest.cpp: In function ‘int main(int, char**)’: siftTest.cpp:7: error: ‘SIFT’ is not a member of ‘cv’ siftTest.cpp:7: error: expected `;' before ‘detector’
我的代码是:Macos ‘;筛选&x2019;不是‘;cv’; 我尝试使用OpenCV的SIFT特征检测器在C++上使用Mac,并且我一直在获得以下错误: siftTest.cpp: In function ‘int main(int, char**)’: siftTest.cpp:7: error: ‘SIFT’ is not a member of ‘cv’ siftTest.cpp:7: error: expected `;' before ‘detector’,macos,opencv,sift,Macos,Opencv,Sift,我的代码是: #include <opencv2/opencv.hpp> #include <iostream> int main (int arg, char *argv[]) { cv::Mat image = cv::imread("fox.jpg", 1); cv::SIFT detector(0, 3, 0.04, 0, 1.6); cv::vector<cv::KeyPoint> keypoints; cv::name
#include <opencv2/opencv.hpp>
#include <iostream>
int main (int arg, char *argv[]) {
cv::Mat image = cv::imread("fox.jpg", 1);
cv::SIFT detector(0, 3, 0.04, 0, 1.6);
cv::vector<cv::KeyPoint> keypoints;
cv::namedWindow("=^..^= FOX =^..^=");
cv::imshow("=^..^= FOX =^..^=", image);
cv::waitKey();
return 0;
}
#包括
#包括
int main(int arg,char*argv[]{
cv::Mat image=cv::imread(“fox.jpg”,1);
cv::SIFT检测器(0,3,0.04,0,1.6);
向量关键点;
cv::namedWindow(“=^..^=FOX=^..^=”);
cv::imshow(“=^..^=FOX=^..^=”,图像);
cv::waitKey();
返回0;
}
我可能只是没有导入一些东西,但我找不到合适的东西/合适的东西组合来让它工作
感谢
SIFT
和SURF
已移动到非自由
模块。您需要添加
#include <opencv2/nonfree/nonfree.hpp>
#包括
带有
opencv\u nonfree
库的标题和链接。SIFT
和SURF
被移动到nonfree
模块。您需要添加
#include <opencv2/nonfree/nonfree.hpp>
#包括
标题并链接到opencv\u nonfree
library