Clear Filters
Clear Filters

MATLAB keeps running out of memory during video processing (Stereo vision)

2 views (last 30 days)
I am trying to do depth estimation from stereo video.
I have two stereo videos (each of size 6 MB only and in mp4 format).
When I run the code (very similar to the depth estimation code provided by MATLAB in this tutorial: https://www.mathworks.com/help/vision/examples/depth-estimation-from-stereo-video.html), MATLAB runs out of memory (I have 16 GB of RAM and MATLAB uses almost 100% of it).
Also I get the following error: "The rectified images do not have enough common rectangle region. Switch to 'full' output view instead."

Answers (1)

Sai Bhargav Avula
Sai Bhargav Avula on 25 Oct 2019
Hi,
By default, MATLAB can use up to 100% of the RAM (not including virtual memory) of your computer to allocate memory for arrays, and if an array would exceed that threshold, then MATLAB returns an error.
You can follow the below link to resolve "Out of Memory" Errors.
Coming to the rectified image error,
By default, rectifyStereoImages crops the output images to only contain the overlap between the two frames. In this case the overlap is very small compared to the disparity.
You can try the following to resolve the issue.
[frameLeftRect, frameRightRect] = rectifyStereoImages(frameLeft, frameRight, stereoParams, 'OutputView', 'Full');
Hope this helps !

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!