Out of memory while taking frames
이전 댓글 표시
I'm writing a program for a project that is becoming more and more complex. Among the others, it calls a function to take pictures (using the webcam package), performs some data extraction from it and then returns this data. This operation involves the communication with 2 devices (an IR camera and a 3d printer) and takes tipically 0.08 seconds. However, in my program this operation must be repeated for a lot of iterations (sometimes it can be 2000) and the program has many different cycles involving this process. I once got a "out of memory" warning in matlab command window with a general consistent slowering of this function (up to 6 s!!!).
function Result_Imaging = AcquisitionIR(IR_cam,Pixels)
frameIR = snapshot(IR_cam);
%My Computation
Result_Imaging = struct%....
end
Is it possible that the pictures I'm taking remain saved in memory even if I'm taking them in a function, performing some calculations and not saving them? I tried adding a
clearvars -except Result_Imaging
at the end of the function but for, for example 100 frames, doesn't make a lot of difference.
The RAM is 16 GB.
답변 (1개)
Shadaab Siddiqie
2021년 3월 3일
0 개 추천
From my understanding you are getting an out of memory error in your project. Here is a resource which might help you to self resolve the issue.
카테고리
도움말 센터 및 File Exchange에서 Video Formats and Interfaces에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!