概述
#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所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复