#include <stdio.h>
#include "cv.h"
#include "highgui.h"
int main( int argc, char **argv )
{
CvCapture *capture = 0;
CvCapture *capture1 =0;
IplImage *frame = 0;
IplImage *frame1=0;
int key = 0;
/* initialize camera */
capture = cvCaptureFromCAM( 0 );
capture = cvCaptureFromCAM( 1 );
/* always check */
// if ( !capture ) {
// fprintf( stderr, "Cannot open initialize webcam!\n" );
// return 1;
// }
//
// if ( !capture1 ) {
// fprintf( stderr, "Cannot open initialize webcam!\n" );
// return 1;
// }
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 480);
cvSetCaptureProperty(capture1, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture1, CV_CAP_PROP_FRAME_HEIGHT, 480);
cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, 8);
cvSetCaptureProperty(capture1, CV_CAP_PROP_FPS, 8);
/* create a window for the video */
cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );
while( key != 'q' ) {
/* get a frame */
frame = cvQueryFrame( capture );
frame1 = cvQueryFrame( capture1 );
/* always check */
// if( !frame ) break;
// if( !frame1 ) break;
/* display current frame */
cvShowImage("Left", frame);
cvShowImage("Right",frame1);
/* exit if user press 'q' */
key = cvWaitKey( 1 );
}
/* free memory */
cvDestroyWindow( "result" );
cvDestroyWindow( "result1" );
cvReleaseCapture( &capture );
cvReleaseCapture( &capture1 );
return 0;
}
#include <stdio.h>
#include "cv.h"
#include "highgui.h"
int main( int argc, char **argv )
{
CvCapture *capture = 0;
CvCapture *capture1 =0;
IplImage *frame = 0;
IplImage *frame1=0;
int key = 0;
/* initialize camera */
capture = cvCaptureFromCAM( 0 );
capture = cvCaptureFromCAM( 1 );
/* always check */
// if ( !capture ) {
// fprintf( stderr, "Cannot open initialize webcam!\n" );
// return 1;
// }
//
// if ( !capture1 ) {
// fprintf( stderr, "Cannot open initialize webcam!\n" );
// return 1;
// }
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 480);
cvSetCaptureProperty(capture1, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture1, CV_CAP_PROP_FRAME_HEIGHT, 480);
cvSetCaptureProperty(capture, CV_CAP_PROP_FPS, 8);
cvSetCaptureProperty(capture1, CV_CAP_PROP_FPS, 8);
/* create a window for the video */
cvNamedWindow( "result", CV_WINDOW_AUTOSIZE );
while( key != 'q' ) {
/* get a frame */
frame = cvQueryFrame( capture );
frame1 = cvQueryFrame( capture1 );
/* always check */
// if( !frame ) break;
// if( !frame1 ) break;
/* display current frame */
cvShowImage("Left", frame);
cvShowImage("Right",frame1);
/* exit if user press 'q' */
key = cvWaitKey( 1 );
}
/* free memory */
cvDestroyWindow( "result" );
cvDestroyWindow( "result1" );
cvReleaseCapture( &capture );
cvReleaseCapture( &capture1 );
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks