复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48#pragma comment(lib,"highgui.lib") #pragma comment(lib,"cxcore.lib") #pragma comment(lib,"cv.lib") #pragma comment(lib,"ml.lib") #pragma comment(lib,"cvaux.lib") #pragma comment(lib,"cvcam.lib") #include "cv.h" #include "highgui.h" #include <stdio.h> #include <cv.h> #include <highgui.h> #include <stdio.h> int main() { CvCapture *capture; IplImage *frame; char AviFileName[]="C:\DX90SDK\Samples\Media\highway.avi"; capture = cvCaptureFromAVI(AviFileName); cvNamedWindow("AVI player",0); cvQueryFrame(capture); // 在读取视频流信息前,要先执行此操作 int frameH = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT); int frameW = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH); int fps = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FPS); int numFrames = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_COUNT); printf("frameH:%d,frameW:%d,fps:%d,numFrames:%dn",frameH,frameW,fps,numFrames); char c; while(true) { //CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture ); //frame=cvRetrieveFrame(capture); //cvShowImage("AVI player",frame); //if(!cvGrabFrame(capture))//在这里,当文件播放完的时候 cvGrabFrame()会自动返回0 // goto the_end; frame=cvQueryFrame(capture); cvShowImage("AVI player",frame); c=cvWaitKey(2); if(c=='q') break; } the_end: cvReleaseCapture(&capture); cvDestroyWindow("AVI player"); return 0; }
最后
以上就是大气月亮最近收集整理的关于cvGetCaptureProperty的全部内容,更多相关cvGetCaptureProperty内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复