Effacer les filtres
Effacer les filtres

Why Matlab reads video frame slowly?

12 vues (au cours des 30 derniers jours)
Eren
Eren le 24 Nov 2016
Commenté : Eren le 24 Nov 2016
I try to read frames from video using the following code.
The original video play so fast, but when I try to read using Matlab, it plays so slow.
Is there any problem with Matlab? (I attached video with this question)
vidObj = VideoReader('unimore.avi');
for i=1:vidObj.NumberOfFrames
v = read(vidObj,i);
imshow(v)
end
Please kindly help, thanks.

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Nov 2016
Each imshow is expensive. It is more efficient to use imshow once, record the handle it returns, and update the CData property of the handle at each step. Or use one of the video player to update, such as vision.videoPlayer
https://www.mathworks.com/help/vision/ref/vision.videoplayer-class.html
  1 commentaire
Eren
Eren le 24 Nov 2016
thanks sir. It works :)

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by