我正在尝试在 QT 中使用 OpenCV 库,但我不断收到不应该发生的错误。
这是我的简单程序的代码。
#include <opencv2/highgui/highgui.hpp>
using namespace cv; //All classes and functions defined in the C++ API of OpenCV are defined within the name space cv.
using namespace std;
int main(){
Mat image = imread("C:/opencv/opencv/samples/c/cat.jpg",CV_LOAD_IMAGE_GRAYSCALE);
cout << "Number of Rows: " << image.rows << endl << "Number of coloumn: " << image.cols;
imshow ("image",image);
waitKey(0);
}
C:\Users\Cipher\Downloads\Programs\untitled2\main.cpp:1:错误:C1083:无法打开包含文件:'highgui.hpp':没有这样的文件或目录
问题是,文件在那里,但 QT 无法找到该文件,我可以访问该文件,即使当我按住 ctrl 并将光标移到 #include <opencv2/highgui/highgui.hpp>
并单击它时,我也成功访问了一个文件,但仍然是 QT一直说它可以找到这样的文件或目录:/有什么问题:/
看一看,
我可以访问 CV 命名空间中的所有方法,那为什么我仍然收到此错误?
看一看,
opencv 的所有功能都可以访问,但我仍然收到上述错误。
请指导我。