out of memory

5 visualizzazioni (ultimi 30 giorni)
Pan
Pan il 13 Feb 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');

Risposta accettata

Walter Roberson
Walter Roberson il 13 Feb 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 Commento
Pan
Pan il 14 Feb 2012
Thank for your proposition!!

Accedi per commentare.

Più risposte (1)

Sean de Wolski
Sean de Wolski il 13 Feb 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 Commenti
Pan
Pan il 14 Feb 2012
32 bit system
Sean de Wolski
Sean de Wolski il 14 Feb 2012
Then you limit is somewhere around 3Gb.

Accedi per commentare.

Categorie

Scopri di più su System Commands in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by