直接看代码好了
#include <iostream> #include <opencv/highgui.h>//这里主要用到窗口显示 int main(int argc, char** argv) { cvNamedWindow("Image", CV_WINDOW_AUTOSIZE); IplImage *img=cvLoadImage("/Users/apple/Pictures/openCV/standard_img/lena.jpg", CV_LOAD_IMAGE_ANYCOLOR); cvShowImage("image", img); cvWaitKey(0); cvReleaseImage(&img); cvDestroyWindow("Image"); return 0; }