Error Using zeros command
Show older comments
Hello,
I am getting the following error:
- _Error using zerosOut of memory. Type HELP MEMORY for your options.
Error in CT2 (line 26) sequence = zeros([size(I) numFrames],class(I));_ *
in the following section of the code (the first line is line 26):
_ sequence = zeros([size(I) numFrames],class(I)); sequence(:,:,1) = I; _
I have a 32 bit system with the following memory (which seems enough for 30 images each being 3001 x 3001 uint 16) info:
Maximum possible array: 505 MB (5.299e+008 bytes) Memory available for all arrays: 1380 MB (1.448e+009 bytes) * Memory used by MATLAB: 427 MB (4.477e+008 bytes) Physical Memory (RAM): 3292 MB (3.452e+009 bytes)
- Limited by contiguous virtual address space available. Limited by virtual address space available.
Any work arounds or pointers?
Thanks,
---Ish
Accepted Answer
More Answers (1)
Image Analyst
on 9 Sep 2014
You, or someone, tagged this as digital image processing. If that's the case, you might be able to use uint8 image/sequence like John mentioned as point 5. Just pass 'uint8' into zeros():
sequence = zeros([size(I), numFrames], 'uint8');
That will cut the memory down by half from what you're currently doing (uint16). It really depends on what you'll be using sequence for. If it will never have values above 255, then uint8 is fine. If you want to stuff a 16 bit image in there, then just divide the image by 256 to scale it down to uint8.
Another thing to check. I is a grayscale image, right? Are you sure? Do this
[rows, columns, numberOfColorChannels] = size(I)
sequence = zeros([rows, columns, numFrames], 'uint8');
Tell me if numberOfColorChannels is 1 or 3.
2 Comments
Ishtiaq Bercha
on 10 Sep 2014
Image Analyst
on 11 Sep 2014
It depends on if you're doing radiometric (intensity) measurements or spatial measurements (like finding areas or outlines). Chances are you can still find the liver or lungs no matter if the data are 16 bit or 8 bit and the borders won't be any different. If you're comparing very slight changes in intensity then your precision will be less.
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!