C++ 未显示OpenCv图像
请看一下下面的代码C++ 未显示OpenCv图像,c++,visual-studio-2010,opencv,C++,Visual Studio 2010,Opencv,请看一下下面的代码 #include <opencv2\core\core.hpp> #include <opencv2\highgui\highgui.hpp> #include <iostream> using namespace std; using namespace cv; int main() { Mat image; try { image = imread("C:/Users/Public/Pict
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
Mat image;
try
{
image = imread("C:/Users/Public/Pictures/Sample Pictures/Chrysanthemum.jpg");
if(!image.data)
{
throw 1;
}
cout << "Height: " << image.size().height << " Width: " << image.size().width << endl;
}
catch(int error)
{
cout << "This message does not exists" << endl;
exit(0);
}
namedWindow("Image 1");
imshow("Image 1",image);
system("pause");
return 0;
}
#包括
#包括
#包括
使用名称空间std;
使用名称空间cv;
int main()
{
Mat图像;
尝试
{
image=imread(“C:/Users/Public/Pictures/Sample Pictures/jummy.jpg”);
如果(!image.data)
{
投掷1枚;
}
不能你需要让窗口刷新。
系统(“暂停”)不执行此操作。
opencv等价物是
等待键(0)