//#include “StdAfx.h”
#include <string>
#include <iostream>
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
using namespace cv;
using namespace std;
int main()
{
//string imageName = "lena.jpg";
string imageName ="C:\\Users\\Administrator\\Desktop\\Lena.jpg";
//讀入圖像
Mat img = imread(imageName, CV_LOAD_IMAGE_COLOR);
//如果讀入圖像失敗
if (img.empty())
{
cout<<"Could not open or find the image!"<<endl;
return -1;
}
//創建窗口
namedWindow("lena", CV_WINDOW_AUTOSIZE);
//顯示圖像
imshow("lena" ,img);
//等待按鍵,按鍵盤任意鍵返回
waitKey(-1);
return 0;
}