out of memory

1 Ansicht (letzte 30 Tage)
Pan
Pan am 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');

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 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 Kommentar
Pan
Pan am 14 Feb. 2012
Thank for your proposition!!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by