Bonjour,
Je souhaite faire une acquisition d'une source video avec opencv mais à partir d'une carte d'acqusition video USB pinnacle 500 (exemple source télévision).
J'utilise le code ci-dessous qui marche parfaitement avec une caméra USB mais pas avec la carte d'acquisition pinnacle. Cela marche mais la cadence de rafraichissement de l'image est très lente : environ une nouvelle image toutes les 30 secondes. Que faut-il faire pour avoir une cadence image fluide pourla vue c'est à dire > 25 images secondes ?
merci
#include
"cv.h"#include
"highgui.h"#include
<stdio.h>const
char * VIDEO_WINDOW = "VideoWindow";int
main( int argc, char** argv ){
CvCapture * pCapture = 0;
IplImage * pVideoFrame = 0;
IplImage * pDisplayImg = 0;
// Initialize video capturepCapture = cvCaptureFromCAM( CV_CAP_ANY );
if( !pCapture ){
fprintf(stderr,
"failed to initialize video capture\n");return -1;}
// Tell user how to exitprintf(
"Press the ESC key to quit\n" );// Create a window to display captured framescvNamedWindow( VIDEO_WINDOW, 1 );
// Capture video frames and display them in the video windowwhile( 1 ){
// Capture the next framepVideoFrame = cvQueryFrame( pCapture );
if( !pVideoFrame ){
fprintf(stderr,
"failed to get a video frame\n");}
// Copy it to the display imageif( !pDisplayImg ){
pDisplayImg = cvCreateImage( cvGetSize(pVideoFrame), 8, 3 );
pDisplayImg->origin = pVideoFrame->origin;
}
cvCopy( pVideoFrame, pDisplayImg, 0 );
// Show the display imagecvShowImage( VIDEO_WINDOW, pDisplayImg );
if( (char)27 == cvWaitKey(10) )break;};
// Close the video-display windowcvDestroyWindow( VIDEO_WINDOW );
// Terminate video capture and free capture resourcescvReleaseCapture( &pCapture );
// Free the display imagecvReleaseImage( &pDisplayImg );
return 0;}