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 Center および File ExchangeMATLAB 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