0
当我更改图像文件名称的顺序(同时更改列表imageFileNames1
和imageFileNames2
)时,校准结果stereoParams
不同(尽管差异很小)。为什么?当点对被重新排序时,MATLAB立体校准结果不同
实施例的代码如下:
第一校准:
imageFileNames1 = {'F:\CaptureFiles\left01.bmp',...
'F:\CaptureFiles\left02.bmp',...
'F:\CaptureFiles\left03.bmp',...
'F:\CaptureFiles\left04.bmp',...
'F:\CaptureFiles\left05.bmp',...
'F:\CaptureFiles\left06.bmp',...
'F:\CaptureFiles\left07.bmp',...
'F:\CaptureFiles\left08.bmp',...
'F:\CaptureFiles\left09.bmp',...
'F:\CaptureFiles\left10.bmp',...
};
imageFileNames2 = {'F:\CaptureFiles\right01.bmp',...
'F:\CaptureFiles\right02.bmp',...
'F:\CaptureFiles\right03.bmp',...
'F:\CaptureFiles\right04.bmp',...
'F:\CaptureFiles\right05.bmp',...
'F:\CaptureFiles\right06.bmp',...
'F:\CaptureFiles\right07.bmp',...
'F:\CaptureFiles\right08.bmp',...
'F:\CaptureFiles\right09.bmp',...
'F:\CaptureFiles\right10.bmp',...
};
% Detect checkerboards in images
[imagePoints, boardSize, imagesUsed] = detectCheckerboardPoints(imageFileNames1, imageFileNames2);
% Generate world coordinates of the checkerboard keypoints
squareSize = 50; % in units of 'mm'
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
% Calibrate the camera
[stereoParams, pairsUsed, estimationErrors] = estimateCameraParameters(imagePoints, worldPoints, ...
'EstimateSkew', false, 'EstimateTangentialDistortion', false, ...
'NumRadialDistortionCoefficients', 2, 'WorldUnits', 'mm', ...
'InitialIntrinsicMatrix', [], 'InitialRadialDistortion', []);
第二校准(imageFileNames的长乐列表):
imageFileNames1 = {'F:\CaptureFiles\left01.bmp',...
'F:\CaptureFiles\left06.bmp',...
'F:\CaptureFiles\left07.bmp',...
'F:\CaptureFiles\left08.bmp',...
'F:\CaptureFiles\left09.bmp',...
'F:\CaptureFiles\left10.bmp',...
'F:\CaptureFiles\left02.bmp',...
'F:\CaptureFiles\left03.bmp',...
'F:\CaptureFiles\left04.bmp',...
'F:\CaptureFiles\left05.bmp',...
};
imageFileNames2 = {'F:\CaptureFiles\right01.bmp',...
'F:\CaptureFiles\right06.bmp',...
'F:\CaptureFiles\right07.bmp',...
'F:\CaptureFiles\right08.bmp',...
'F:\CaptureFiles\right09.bmp',...
'F:\CaptureFiles\right10.bmp',...
'F:\CaptureFiles\right02.bmp',...
'F:\CaptureFiles\right03.bmp',...
'F:\CaptureFiles\right04.bmp',...
'F:\CaptureFiles\right05.bmp',...
};
% Detect checkerboards in images
[imagePoints, boardSize, imagesUsed] = detectCheckerboardPoints(imageFileNames1, imageFileNames2);
% Generate world coordinates of the checkerboard keypoints
squareSize = 50; % in units of 'mm'
worldPoints = generateCheckerboardPoints(boardSize, squareSize);
% Calibrate the camera
[stereoParams, pairsUsed, estimationErrors] = estimateCameraParameters(imagePoints, worldPoints, ...
'EstimateSkew', false, 'EstimateTangentialDistortion', false, ...
'NumRadialDistortionCoefficients', 2, 'WorldUnits', 'mm', ...
'InitialIntrinsicMatrix', [], 'InitialRadialDistortion', []);