图片的名称 aa.jpg
图片的位置 K:\mfc_CV\2015-05-15A\MY\MY
图片的内容 斯嘉丽的艺术照
代码如下
#include "stdafx.h"
#include <opencv2\opencv.hpp>
#include <iostream>
#include <conio.h>
#include <string>
using namespace cv;
using namespace std;
int main()
{
Mat img = imread("aa.jpg");
if(img.empty())
{
cout<<"error"<<endl;
_getch();
return -1;
}
imshow("mypic",img);
waitKey();
_getch();
return 0;
}