Why am I getting 'Out of Memory' error?

1 view (last 30 days)
Trishia Chemaly
Trishia Chemaly on 28 Feb 2017
Commented: Trishia Chemaly on 28 Feb 2017
I am using MATLAB R2016b.
My laptop is a 64-bit 8 GB RAM machine.
I am trying to rectify 2 RGB images. (Size: 400x300x3)
The following is my code:
%Load stereo parameters
load('params.mat');
%Read the images
I1 = imread('gLeft.jpg');
I2 = imread('gRight.jpg');
%Convert to grayscale
I1=rgb2gray(I1);
I2=rgb2gray(I2);
%Rectify stereo images
[J1, J2] = rectifyStereoImages(I1, I2, stereoParams);
The error I obtain is:
Error using horzcat
Out of memory. Type HELP MEMORY for your options.
When I type memory in the command window, I obtain:
Maximum possible array: 9234 MB (9.682e+09 bytes) *
Memory available for all arrays: 9234 MB (9.682e+09 bytes) *
Memory used by MATLAB: 1228 MB (1.288e+09 bytes)
Physical Memory (RAM): 7914 MB (8.299e+09 bytes)
  3 Comments
Walter Roberson
Walter Roberson on 28 Feb 2017
You have not said anything about how big the images are.
Trishia Chemaly
Trishia Chemaly on 28 Feb 2017
-The images are originally RGB 400x300x3. I am converting them to grayscale so the size would be 400x300. -'params.mat' contains the stereo parameters of the 2 cameras

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!