Error Using zeros command
显示 更早的评论
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
采纳的回答
更多回答(1 个)
Image Analyst
2014-9-9
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 个评论
Ishtiaq Bercha
2014-9-10
Image Analyst
2014-9-11
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!