我按照官方教程以及以下链接opencv-installation编译并安装了 OpenCV 库
我使用了官方教程中提供的示例代码 using eclipse cdt
#include <cv.h>
#include <highgui.h>
using namespace cv;
int main( int argc, char** argv )
{
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);
return 0;
}
编译后出现以下错误:
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/hp/apps/opencv-2.4.6.1/modules/highgui/src/window.cpp, line 261
terminate called after throwing an instance of 'cv::Exception'
what(): /home/hp/apps/opencv-2.4.6.1/modules/highgui/src/window.cpp:261: error: (-215) size.width>0 && size.height>0 in function imshow
提前致谢