message :conversion double from struct impossible
Bonjour après recherche de documentation pour lire une video sur le site:
http://www.mathworks.com/access/help...html#br9cnb8-1
J'ai vu qu'il fallai réserver de la mémoire pour une video.
J'ai donc executé le code qu'il propose:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
[FileName,PathName] = uigetfile('*.avi','sélectionnez votre video');
file = fullfile(PathName,FileName);
VidEcho = mmreader(file);
info = get(VidEcho)
nFrames = VidEcho.NumberOfFrames;
vidHeight = VidEcho.Height;
vidWidth = VidEcho.Width;
% % Preallocate movie structure.
mov(1:nFrames) = struct('cdata', zeros(vidHeight, vidWidth, 3, 'uint8'),'colormap', []);
% Read one frame at a time.
for k = 1 : nFrames
mov(k).cdata = read(VidEcho, k);
end
% Play back the movie once at the video's frame rate.
movie(mov, 1, VidEcho.FrameRate); |
Mais voici le message d'erreur:
Code:
1 2 3 4 5 6 7 8 9
| ??? The following error occurred converting from struct to double:
Error using ==> double
Conversion to double from struct is not possible.
Error in ==> data>charger_video at 62
mov(1:nFrames) = struct('cdata', zeros(vidHeight, vidWidth, 3,
'uint8'),'colormap', []);
??? Error while evaluating uicontrol Callback |