out of memory

5 visualizaciones (últimos 30 días)
Pan
Pan el 13 de Feb. de 2012
clear all
mov = aviread('book.avi');
xy=zeros([size(mov(1).cdata),length(mov)], 'uint8');
for ii=1:537
figure(10)
ii
xy(:,:,:,ii)=mov(ii).cdata;
imshow(xy(:,:,:,ii));
endwhen I read the code,these message also show again.
pleas teach me how to do
thank!
??? Error using ==> zeros
Out of memory. Type HELP MEMORY for your options.
Error in ==> framebook at 3 xy=zeros([size(mov(1).cdata),length(mov)], 'uint8');

Respuesta aceptada

Walter Roberson
Walter Roberson el 13 de Feb. de 2012
I did warn you in your previous thread on this topic to expect to run out of memory. No matter how much memory you have, there will be a movie bigger than that.
Are you certain that you need to store the data as a 4D array, and cannot process it in the mov struct instead?
Anyhow:
numframe = 537;
ii = 1;
thisframe = aviread('book.avi', ii);
xy = repmat(thisframe.cdata, [1, 1, 1, numframe]);
figure(10);
ii
imshow(thisframe.cdata);
drawnow();
for ii = 2 : numframe
thisframe = aviread('book.avi', ii);
xy(:,:,:,ii) = thisframe.cdata;
ii
imshow(thisframe.cdata);
drawnow();
end
Please expect this to be notably slower than your previous code. As usual, fast operations depend upon having a lot of memory, which you do not have.
  1 comentario
Pan
Pan el 14 de Feb. de 2012
Thank for your proposition!!

Iniciar sesión para comentar.

Más respuestas (1)

Sean de Wolski
Sean de Wolski el 13 de Feb. de 2012
you're trying to create an array the size of
[size(mov(1).cdata),length(mov)]
i.e.
prod([size(mov(1).cdata),length(mov)])
many elements.
How much RAM do you have? Are you on a 64bit system (capable of having more than 3gb of memory)?
  3 comentarios
Pan
Pan el 14 de Feb. de 2012
32 bit system
Sean de Wolski
Sean de Wolski el 14 de Feb. de 2012
Then you limit is somewhere around 3Gb.

Iniciar sesión para comentar.

Categorías

Más información sobre System Commands en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by