我在Eclipse中运行下面的代码,成功包含了路径和库,但是运行代码时显示错误。
#include <cv.h>
#include<stdio.h>
#include <highgui.h>
//using namespace cv;
int main()
{
Mat image;
image = imread( argv[1], 1 );
if( argc != 2 || !image.data )
{
printf( "No image data \n" );
return -1;
}
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE );
imshow( "Display Image", image );
waitKey(0);
printf("this is open cv programming");
return 0;
}
最佳答案
您的main()签名不完整
尝试
int main(int argc, char* argv[])
argc // an int indicating the number of arguments passed in to the function
argv[] // an array of character strings, the actual arguments.
https://stackoverflow.com/questions/14273139/