IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Images Discussion :

[Computer Vision Toolbox] Convertir format avi


Sujet :

Images

  1. #1
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2014
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2014
    Messages : 6
    Points : 4
    Points
    4
    Par défaut [Computer Vision Toolbox] Convertir format avi
    J'ai trouvé un programme sous matlab (file exchange);mais mon probleme comment obtention resultat de video format AVI:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
     
    videoFReader = vision.VideoFileReader('viplanedeparture.avi');
    videoPlayer = vision.VideoPlayer;
     
    while ~isDone(videoFReader)
       frame = step(videoFReader);
       step(videoPlayer,frame);
    end
     
    release(videoFReader);
    release(videoPlayer);

  2. #2
    Rédacteur/Modérateur

    Avatar de Jerome Briot
    Homme Profil pro
    Freelance mécatronique - Conseil, conception et formation
    Inscrit en
    Novembre 2006
    Messages
    20 302
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance mécatronique - Conseil, conception et formation

    Informations forums :
    Inscription : Novembre 2006
    Messages : 20 302
    Points : 53 166
    Points
    53 166
    Par défaut
    La question n'est pas claire
    Ingénieur indépendant en mécatronique - Conseil, conception et formation
    • Conception mécanique (Autodesk Fusion 360)
    • Impression 3D (Ultimaker)
    • Développement informatique (Python, MATLAB, C)
    • Programmation de microcontrôleur (Microchip PIC, ESP32, Raspberry Pi, Arduino…)

    « J'étais le meilleur ami que le vieux Jim avait au monde. Il fallait choisir. J'ai réfléchi un moment, puis je me suis dit : "Tant pis ! J'irai en enfer" » (Saint Huck)

  3. #3
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2014
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2014
    Messages : 6
    Points : 4
    Points
    4
    Par défaut salut..................
    le résultat de ce programme qui affiche la video a la fenetre matlab.
    Ma question est :Je veux faire l'enregistrement du résultat sous forme de vidéo avi
    et merci.....

  4. #4
    Rédacteur/Modérateur

    Avatar de Jerome Briot
    Homme Profil pro
    Freelance mécatronique - Conseil, conception et formation
    Inscrit en
    Novembre 2006
    Messages
    20 302
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance mécatronique - Conseil, conception et formation

    Informations forums :
    Inscription : Novembre 2006
    Messages : 20 302
    Points : 53 166
    Points
    53 166
    Par défaut
    Je ne comprend toujours pas. Tu as un fichier AVI et tu affiches la vidéo avec MATLAB

    Maintenant tu voudrais enregistrer cette vidéo dans un autre fichier AVI ?
    Ingénieur indépendant en mécatronique - Conseil, conception et formation
    • Conception mécanique (Autodesk Fusion 360)
    • Impression 3D (Ultimaker)
    • Développement informatique (Python, MATLAB, C)
    • Programmation de microcontrôleur (Microchip PIC, ESP32, Raspberry Pi, Arduino…)

    « J'étais le meilleur ami que le vieux Jim avait au monde. Il fallait choisir. J'ai réfléchi un moment, puis je me suis dit : "Tant pis ! J'irai en enfer" » (Saint Huck)

  5. #5
    Candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Septembre 2014
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 34
    Localisation : Algérie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Septembre 2014
    Messages : 6
    Points : 4
    Points
    4
    Par défaut salut
    le résultat de ce programme qui affiche la video a la fenetre matlab.
    Ma question est :Je veux faire l'enregistrement du résultat de vidéo sous format avi
    par exemple de programme dans math works:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    %Face Detection and Tracking Using CAMShift
     
     
    % Create a cascade detector object.
    faceDetector = vision.CascadeObjectDetector();
     
    % Read a video frame and run the detector.
    videoFileReader = vision.VideoFileReader('visionface.avi');
    videoFrame      = step(videoFileReader);
    bbox            = step(faceDetector, videoFrame);
     
    % Draw the returned bounding box around the detected face.
    videoOut = insertObjectAnnotation(videoFrame,'rectangle',bbox,'Face');
    figure, imshow(videoOut), title('Detected face');
     
    % Get the skin tone information by extracting the Hue from the video frame
    % converted to the HSV color space.
    [hueChannel,~,~] = rgb2hsv(videoFrame);
     
    % Display the Hue Channel data and draw the bounding box around the face.
    figure, imshow(hueChannel), title('Hue channel data');
    rectangle('Position',bbox(1,:),'LineWidth',2,'EdgeColor',[1 1 0])
     
    % Detect the nose within the face region. The nose provides a more accurate
    % measure of the skin tone because it does not contain any background
    % pixels.
    noseDetector = vision.CascadeObjectDetector('Nose');
    faceImage    = imcrop(videoFrame,bbox(1,:));
    noseBBox     = step(noseDetector,faceImage);
     
    % The nose bounding box is defined relative to the cropped face image.
    % Adjust the nose bounding box so that it is relative to the original video
    % frame.
    noseBBox(1,1:2) = noseBBox(1,1:2) + bbox(1,1:2);
     
    % Create a tracker object.
    tracker = vision.HistogramBasedTracker;
     
    % Initialize the tracker histogram using the Hue channel pixels from the
    % nose.
    initializeObject(tracker, hueChannel, noseBBox(1,:));
     
    % Create a video player object for displaying video frames.
    videoInfo    = info(videoFileReader);
    videoPlayer  = vision.VideoPlayer('Position',[300 300 videoInfo.VideoSize+30]);
     
    % Track the face over successive video frames until the video is finished.
    while ~isDone(videoFileReader)
     
        % Extract the next video frame
        videoFrame = step(videoFileReader);
     
        % RGB -> HSV
        [hueChannel,~,~] = rgb2hsv(videoFrame);
     
        % Track using the Hue channel data
        bbox = step(tracker, hueChannel);
     
        % Insert a bounding box around the object being tracked
        videoOut = insertObjectAnnotation(videoFrame,'rectangle',bbox,'Face');
     
        % Display the annotated video frame using the video player object
        step(videoPlayer, videoOut);
     
    end
     
    % Release resources
    release(videoFileReader);
    release(videoPlayer);
    et merci.

  6. #6
    Rédacteur/Modérateur

    Avatar de Jerome Briot
    Homme Profil pro
    Freelance mécatronique - Conseil, conception et formation
    Inscrit en
    Novembre 2006
    Messages
    20 302
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance mécatronique - Conseil, conception et formation

    Informations forums :
    Inscription : Novembre 2006
    Messages : 20 302
    Points : 53 166
    Points
    53 166
    Par défaut
    Tu peux sans doute utiliser la classe vision.VideoFileWriter

    Je ne possède par la Computer Vison Toolbox, mais essaie peut être ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    %Face Detection and Tracking Using CAMShift
     
     
    % Create a cascade detector object.
    faceDetector = vision.CascadeObjectDetector();
     
    % Read a video frame and run the detector.
    videoFileReader = vision.VideoFileReader('visionface.avi');
    videoFrame      = step(videoFileReader);
    bbox            = step(faceDetector, videoFrame);
     
    % Draw the returned bounding box around the detected face.
    videoOut = insertObjectAnnotation(videoFrame,'rectangle',bbox,'Face');
    figure, imshow(videoOut), title('Detected face');
     
    % Get the skin tone information by extracting the Hue from the video frame
    % converted to the HSV color space.
    [hueChannel,~,~] = rgb2hsv(videoFrame);
     
    % Display the Hue Channel data and draw the bounding box around the face.
    figure, imshow(hueChannel), title('Hue channel data');
    rectangle('Position',bbox(1,:),'LineWidth',2,'EdgeColor',[1 1 0])
     
    % Detect the nose within the face region. The nose provides a more accurate
    % measure of the skin tone because it does not contain any background
    % pixels.
    noseDetector = vision.CascadeObjectDetector('Nose');
    faceImage    = imcrop(videoFrame,bbox(1,:));
    noseBBox     = step(noseDetector,faceImage);
     
    % The nose bounding box is defined relative to the cropped face image.
    % Adjust the nose bounding box so that it is relative to the original video
    % frame.
    noseBBox(1,1:2) = noseBBox(1,1:2) + bbox(1,1:2);
     
    % Create a tracker object.
    tracker = vision.HistogramBasedTracker;
     
    % Initialize the tracker histogram using the Hue channel pixels from the
    % nose.
    initializeObject(tracker, hueChannel, noseBBox(1,:));
     
    % Create a video player object for displaying video frames.
    videoInfo    = info(videoFileReader);
    videoPlayer  = vision.VideoPlayer('Position',[300 300 videoInfo.VideoSize+30]);
     
    vision.VideoFileWriter('myFile.avi','FrameRate',videoFileReader.info.VideoFrameRate);
     
    % Track the face over successive video frames until the video is finished.
    while ~isDone(videoFileReader)
     
        % Extract the next video frame
        videoFrame = step(videoFileReader);
     
        % RGB -> HSV
        [hueChannel,~,~] = rgb2hsv(videoFrame);
     
        % Track using the Hue channel data
        bbox = step(tracker, hueChannel);
     
        % Insert a bounding box around the object being tracked
        videoOut = insertObjectAnnotation(videoFrame,'rectangle',bbox,'Face');
     
        % Display the annotated video frame using the video player object
        step(videoPlayer, videoOut);
        step(videoFWriter, videoOut);
    end
     
    % Release resources
    release(videoFileReader);
    release(videoPlayer);
    release(videoFWriter);
    Ingénieur indépendant en mécatronique - Conseil, conception et formation
    • Conception mécanique (Autodesk Fusion 360)
    • Impression 3D (Ultimaker)
    • Développement informatique (Python, MATLAB, C)
    • Programmation de microcontrôleur (Microchip PIC, ESP32, Raspberry Pi, Arduino…)

    « J'étais le meilleur ami que le vieux Jim avait au monde. Il fallait choisir. J'ai réfléchi un moment, puis je me suis dit : "Tant pis ! J'irai en enfer" » (Saint Huck)

Discussions similaires

  1. Convertir une vidéo (au format MOV) au format AVI
    Par Mariion dans le forum Vidéo
    Réponses: 2
    Dernier message: 14/11/2010, 19h09
  2. [Dates] Convertir format anglophone vers francophone
    Par mickado dans le forum Langage
    Réponses: 2
    Dernier message: 22/07/2007, 19h00
  3. Montage video avec format .avi
    Par yeah_baby64 dans le forum Vidéo
    Réponses: 3
    Dernier message: 19/06/2007, 12h23
  4. Comment faire une video au format avi ?
    Par fab.faust dans le forum MATLAB
    Réponses: 1
    Dernier message: 27/03/2007, 01h41
  5. [Video] Video au format AVI (SEDG)
    Par TanKer dans le forum Vidéo
    Réponses: 5
    Dernier message: 09/01/2007, 23h07

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo