Tuesday, January 29, 2013

Capture Video With OpenCV

[sourcecode language="cpp"]
#include "stdafx.h"
#include<opencv\cv.h>
#include<opencv\cxcore.h>
#include<opencv\highgui.h>

using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{

CvCapture *capture = cvCaptureFromCAM(0);
if( !capture ) return 1;
cvNamedWindow("Video");

while(true) {

IplImage* frame = cvQueryFrame( capture );
if( !frame ) break;
cvShowImage( "Video", frame );
int c = cvWaitKey(40);
if((char)c==20 ) break;
}

cvDestroyWindow("Video");
cvReleaseCapture( &capture );
return 0;
}

&nbsp;

[/sourcecode]

No comments:

Post a Comment

How to enable CORS in Laravel 5

https://www.youtube.com/watch?v=PozYTvmgcVE 1. Add middleware php artisan make:middleware Cors return $next($request) ->header('Acces...