OpenCV PS 3的眼睛

我在Ubuntu 10.10上,试图从ps3eye摄像头捕捉video,afaik OpenCV使用v4l从networking摄像头,gucview,奶酪,vlc捕获所有可以访问和使用摄像头,但使用opencv捕获它时,我得到空白帧。

/** * Display video from webcam * * Author Nash * License GPL * Website http://nashruddin.com */ //gcc test.c -I /usr/include/opencv/ -L /usr/lib/ -lcv -lhighgui #include <stdio.h> #include "cv.h" #include "highgui.h" int main( int argc, char **argv ) { CvCapture *capture = 0; IplImage *frame = 0; int key = 0; /* initialize camera */ capture = cvCaptureFromCAM( -1 ); /* always check */ if ( !capture ) { fprintf( stderr, "Cannot open initialize webcam!\n" ); return 1; } /* create a window for the video */ cvNamedWindow( "result", CV_WINDOW_AUTOSIZE ); while( key != 'q' ) { /* get a frame */ frame = cvQueryFrame( capture ); /* always check */ if( !frame ) break; /* display current frame */ cvShowImage( "result", frame ); /* exit if user press 'q' */ key = cvWaitKey( 1 ); } /* free memory */ cvDestroyWindow( "result" ); cvReleaseCapture( &capture ); return 0; }