找不到opencv未读或未读未返回值[imread(argv [1],CV_LOAD_IMAGE_COLOR); ] [英] opencv imread not found or imread not return value [ imread(argv[1], CV_LOAD_IMAGE_COLOR); ]
本文介绍了找不到opencv未读或未读未返回值[imread(argv [1],CV_LOAD_IMAGE_COLOR); ]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
opencv未读或未读未返回值.在Opencv(Visual Studio 2010)中发现未返回值或给出错误未发现错误
opencv imread not found or imread not return value. imread not return value or give error imread NOT FOUND in Opencv (visual Studio 2010)
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;
}
推荐答案
Make sure the image file format is one of the supported types (http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#imread). Also ensure that the filepath given as the argument is correct. You could also use drag & drop the image on the executable file.
这篇关于找不到opencv未读或未读未返回值[imread(argv [1],CV_LOAD_IMAGE_COLOR); ]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文