第一个opencv程序,用于打开一幅图像。
代码如下:
#include "stdafx.h"
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"highgui.lib")
#pragma comment(lib,"cxcore.lib")
#include <cv.h>
#include <highgui.h>
int main(int argc, char* argv[])
{
IplImage *src = cvLoadImage("D:\\test_image\\72500.jpeg",CV_LOAD_IMAGE_COLOR);
cvNamedWindow("first_image");
cvShowImage("first_image",src);
cvWaitKey(0);
cvReleaseImage(&src);
cvDestroyWindow("first_image");
//printf("Hello World!\n");
return 0;
}