Memory issues with matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I guess MATLAB can only process uncompressed video.I am extracting the images from a video file and storing it in a variable. ( I have used cell to store a sequence of images ).The problem is as size of the video file increases, I run into out of memory problem. Can someone please suggest me on how to store images from a video file, should I write them all to a disk or use dynamic memory allocation ? Please advise me as I am not sure of how to allocate memory dynamically in Matlab .
Thanks, Sakthi
0 comentarios
Respuesta aceptada
Walter Roberson
el 18 de Oct. de 2012
Using cell arrays effectively is dynamic memory allocation in MATLAB. If you are running out of memory using that, then you are running out of memory and need a different strategy.
64 bit MATLAB with plenty of RAM will postpone running out of memory (but cannot prevent it.)
Writing frames to disk from time to time can have difficulties if the time required to write to disk is sufficient that you start dropping frames, but that would not be a problem if you are reading the frames from a file. You would probably prefer to bundle up several frames as writing more data at a time is usually more efficient. That might not make sense in terms of your process flow, though.
In some cases it makes sense to write buffers of data out to disk as pure binary, fixed size frames within a single file, and then once the reading of the original source is completed, to go into the buffering file and read out the data from it and post-process it as desired. This would, however, be of less benefit when reading your source from a file.
To reduce your file write times significantly, try to use an SSD, or at least a fast disk drive. For example, USB2 would not be advisable: use Firewire 800 or USB3 at least. But keep in mind that higher speed disk interfaces need faster disk assemblies to keep up: 7200 rpm or 10000 rpm rather than 5400 rpm. A RAID assembly can work wonders for getting high speed mass storage. But SSD is faster yet. (The new Apple/Intel "Lightning" interface is nice in theory, but the only hard-drives rated to keep up with it are some $3000+ RAID assemblies.)
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!