gpt4 book ai didi

opencv - 简历.h : file not found opencv

转载 作者:太空宇宙 更新时间:2023-11-03 21:27:50 27 4
gpt4 key购买 nike

我正在运行这段代码:

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv ) {
if( argc != 2)
{
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}

Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file

if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}

namedWindow( "Display window", CV_WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image ); // Show our image inside it.

waitKey(0); // Wait for a keystroke in the window
return 0; }

但它对我不起作用,因为当我编写 cmake 时它会在我的屏幕上显示此错误。在终端:

cv.h: file not found.

谁能帮帮我?它在一个月前工作。

最佳答案

你有链接问题,试试这个;

g++ `pkg-config --cflags --libs opencv` filename.cpp -o filename

关于opencv - 简历.h : file not found opencv,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19503199/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com