out of memory using estimateCameraParameters

2 visualizaciones (últimos 30 días)
Ilya K
Ilya K el 9 de En. de 2022
Respondida: Shreeya el 15 de En. de 2024
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.

Respuestas (1)

Shreeya
Shreeya el 15 de En. de 2024
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

Categorías

Más información sobre MATLAB Support Package for USB Webcams en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by