#include "stdafx.h"
#include "cv.h"
#include "highgui.h"
int main(int argc, char** argv)
{
CvCapture *capture = cvCreateFileCapture( "C:\\Users\\sl\\Documents\\Visual Studio 2005\\Projects\\test\\test\\12.avi" );
if(!capture)
{
return-1;
}
double fps = cvGetCaptureProperty(capture,CV_CAP_PROP_FPS);
CvSize size = cvSize(
(int)cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH),
(int)cvGetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT)
);
CvVideoWriter *writer = cvCreateVideoWriter("out.avi",CV_FOURCC('M','J','P','G'),fps,size);
IplImage* logpolar_frame = cvCreateImage(size,IPL_DEPTH_8U,3);
cvNamedWindow("haha");//我另外加入的
IplImage *bgr_frame;
while( (bgr_frame=cvQueryFrame(capture)) != NULL )
{
bgr_frame=cvQueryFrame(capture);//Init the video read
cvLogPolar( bgr_frame, logpolar_frame,cvPoint2D32f(bgr_frame->width/2,
bgr_frame->height/2),40,CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS );
cvShowImage("haha",bgr_frame);//是我另外加入的
cvWriteFrame( writer, logpolar_frame );
}
cvReleaseVideoWriter( &writer );
cvReleaseImage( &logpolar_frame );
cvReleaseCapture( &capture );
cvDestroyWindow("show");
return(0);
}
|