OPENCV(1)图片,视频读入,输出(highgui)

1.图像显示

cvnamewindows();

cvshow();

cvwaitkey();

cvdestroywindow()

修改图像显示大小:

ResizeWindow( const char* name, int width, int height );

定义显示窗口位置:

void cvMoveWindow( const char* name, int x, int y );

控制trackbar,没做研究

2.图像载入、保存

cvloadimage();

cvsaveimage();

3.AVI视频播放

cvCapture *pCapture = cvCreateFileCapture();  //从文件中读取

CvCapture* cvCreateCameraCapture( int index ); // 摄像机抓拍,支持VFM模型摄像机

cvReleaseCapture ();//释放

cvQueryFrame(cvCapture *)                             // 直接抓拍一振图像

int cvGrabFrame( CvCapture* capture );         //抓拍(多个摄像机的时候,可以作为同步使用)

IplImage* cvRetrieveFrame( CvCapture* capture ); //取回由函数cvGrabFrame抓取的图像

int cvSetCaptureProperty( CvCapture* capture, int property_id, double value ); //属性设置于读取(有些参数控制不了,比如帧速)

double cvGetCaptureProperty( CvCapture* capture, int property_id );

CvVideoWriter* cvCreateVideoWriter( const char* filename, int fourcc, double fps, CvSize frame_size, int is_color=1 );//写视频

int cvWriteFrame( CvVideoWriter* writer, const IplImage* image );  //写入图像帧  (opencv的帧速不太准确)

使用C++版本,可以参考http://www.cnblogs.com/tornadomeet/archive/2012/04/23/2467153.html

原文地址:https://www.cnblogs.com/zsb517/p/2533542.html