OpenCV IPL AVI Nombre de trames : (

cs_kididouille Messages postés 20 Date d'inscription lundi 27 mars 2006 Statut Membre Dernière intervention 18 janvier 2009 - 13 avril 2006 à 16:12
jmdiverrez Messages postés 1 Date d'inscription jeudi 15 février 2007 Statut Membre Dernière intervention 23 mars 2007 - 23 mars 2007 à 10:38
Bonjour à tous j'espere que quelqu'un pourra m'aider, voici ma requete:
Je cherche à connaitre le nombre d'image qui composent un fichier AVI
Pour lire cet Avi j'utilise les IPL et OpenCV.
Les fonctions d'OpenCV permettent de traiter facilement les images qui composent un fichier AVI sauf qu'elles ne permettent pas de savoir combien il y a d'image (on trouve facilement sur le net la structure d'une IplImage) je voulais la structure d'une cvCapture à partir duquel on extrait les images pensant que l'info du nombre d'image était là dedans.
En fouinant dans les .h je suis tombé sur une sorte de définition de cvCapture du genre //black box
Regardez le debut de mon prog:
input_video est de type cvCapture
frame du type IplImage
(NomFichier un CString)


CFileDialog FileData(TRUE,"*.avi",NULL,OFN_OVERWRITEPROMPT,"Séquences vidéos de la cam(*.avi)|*.avi||",this);
FileData.DoModal();
NomFichier=FileData.GetPathName();
input_video= cvCaptureFromFile(NomFichier);
cvNamedWindow("Fastcam",CV_WINDOW_AUTOSIZE);
cvSetCaptureProperty(input_video,CV_CAP_PROP_POS_FRAMES,0);
frame=cvQueryFrame(input_video);
cvShowImage("Fastcam",frame);

Bon weekend de Pack à tous!!!
Des chocolats à toc tant que l'on ne vous prend pas pour une cloche (ouao) ou un lapin de trois jours (cette année le confinement des volailles restreint le nombre de poules en chocolats!!)

1 réponse

jmdiverrez Messages postés 1 Date d'inscription jeudi 15 février 2007 Statut Membre Dernière intervention 23 mars 2007
23 mars 2007 à 10:38
Je suis hyper débutant mais peut etre que cela pourra t'aider:
cvGetCaptureProperty
Gets video capturing properties

double cvGetCaptureProperty( CvCapture* capture, int property_id );

* capture : video capturing structure.

* property_id : property identifier. Can be one of the following:

<tt>CV_CAP_PROP_POS_MSEC</tt>, film current position in milliseconds or video capture timestamp, ----
<tt>CV_CAP_PROP_POS_FRAMES</tt>, 0-based index of the frame to be decoded/captured next, ----
<tt>CV_CAP_PROP_POS_AVI_RATIO</tt>, relative position of video file (0 - start of the film, 1 - end of the film), ----
<tt>CV_CAP_PROP_FRAME_WIDTH</tt>, width of frames in the video stream, ----
<tt>CV_CAP_PROP_FRAME_HEIGHT</tt>, height of frames in the video stream, ----
<tt>CV_CAP_PROP_FPS</tt>, frame rate, ----
<tt>CV_CAP_PROP_FOURCC</tt>, 4-character code of codec, ----
<tt>CV_CAP_PROP_FRAME_COUNT</tt>, number of frames in video file, ----
<tt>CV_CAP_PROP_BRIGHTNESS</tt>, brightness of image (only for cameras), ----
<tt>CV_CAP_PROP_CONTRAST</tt>, contrast of image (only for cameras), ----
<tt>CV_CAP_PROP_SATURATION</tt>, saturation of image (only for cameras), ----
<tt>CV_CAP_PROP_HUE</tt>, hue of image (only for cameras)

The function <tt>cvGetCaptureProperty</tt> retrieves the specified property of camera or video file
0
Rejoignez-nous