out of memory using estimateCameraParameters

조회 수: 2 (최근 30일)
Ilya K
Ilya K 2022년 1월 9일
답변: Shreeya 2024년 1월 15일
I'm doing a single camera callibration and I'm using a pretty much lazy method. Instead of taking some small amount of images, I film a short video of many frames of the chess board from different obstacles and distances and pass them all to the function, so it make the best fit (because I'm not an expert).
I'm doing pretty much the same things as in the example.
images = string(ls("G:\Vista_project\cur\"));
images = images(3:end);
images = arrayfun(@(s) append("G:\Vista_project\cur\", s), images);
[imagePoints, boardSize] = detectCheckerboardPoints(images);
imagePoints = squeeze(imagePoints);
squareSizeInMM = 20;
worldPoints = generateCheckerboardPoints(boardSize,squareSizeInMM);
I = imread("G:\Vista_project\cur\Vista_project0tc10202.jpg");
imageSize = [size(I, 1),size(I, 2)];
params = estimateCameraParameters(imagePoints,worldPoints,'ImageSize',imageSize);
How can I compute the maximal images that I can have in my directory so matlab could manage this method (estimateCameraParameters) without out of memory error (I have 16 GB).
That is the only thing I thought to resolve the problem ( to calculate manually what is my overload), because I don't want to choose the good photos manually, because I don't know which will give me the best callibration results.
My images of size 512 x 640 with 16 bit per pixel with one channel.The out of memory happens with 2223 images for callibration.
And a future question, how much for same images stereo callibration consumes ? Is it x2 (double of the memory as for one) ?
Thank you in advance.

답변 (1개)

Shreeya
Shreeya 2024년 1월 15일
The image array accounts for 512*640*3*16*2223 bits (width*height*channels*number of bits per channel*number of images) of memory in the workspace. Since this array is not needed after calling the detectCheckerboardPoints function, clearing it before proceeding with the next computations can help mitigate the out of memory error.
You can use the following command in the MATLAB command window to clear the image array:
clear images

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for USB Webcams에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by