调用函数
imread(” YY01.jpg”,CV_LOAD_IMAGE_COLOR); //读入图片
namedWindow(“Disp YY”,WINDOW_AUTOSIZE); //建立窗口
imshow(“Disp YY”,image); //图片显示
waitKey(0); //显示等待**
#include"cv.h"
#include"highgui.h"
using namespace cv;
using namespace std;
int main(void)
{
Mat image;
image = imread(" YY01.jpg",CV_LOAD_IMAGE_COLOR);
//image = imread("YY01.jpg",CV_LOAD_IMAGE_UNCHANGED); include alpha
//image = imread("YY01.jpg",CV_LOAD_IMAGE_GRAYSCALE); only intensity
if(!image.data) //check
{
cout<<"Open Wrong"<<endl;
return -1;
}
namedWindow("Disp YY",WINDOW_AUTOSIZE); //create a window
imshow("Disp YY",image); //show
waitKey(0); //wait for
return 0;
}