#include "stdafx.h"
#include "opencv2\opencv.hpp"
using namespace cv;
using namespace std;
int main()
{
Mat src;
//加载图片
src = imread("test.jpg");
//检测是否加载成功
if (!src.data)
{
cout << "Could not open or find the image" << endl;
return -1;
}
// 创建窗口
namedWindow("显示图片");
//显示图像
imshow("显示图片", src);
//暂停,等待按键结束
waitKey(0);
destroyAllWindows();
return 0;
}