2017-10-19 44 views
0

当我更改图像文件名称的顺序(同时更改列表imageFileNames1imageFileNames2)时,校准结果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', []); 

回答

0

estimateCameraParameters文档:

摄像机校准会估计内部参数,外部参数和失真系数的值。相机校准涉及两个步骤:

  1. 假设镜头失真为零,求解封闭形式的内在和外在因素。

  2. 使用非线性最小二乘最小化(Levenberg-Marquardt算法)同时估计所有参数,包括失真系数。使用上一步的封闭形式解决方案作为内部函数和外部函数的初始估计。然后将失真系数的初始估计值设置为零。重新排序在这两个阶段中的点对时

数值的差异可以发生。

  1. 对方程的重新排序可能会对numerical least squares的结果产生轻微影响。
  2. iterative minimization method可能仅在部分速度中使用数据,即使不是它再次求解(阻尼)线性方程组,因此可能会受到重新排序的影响。

这只能解释小的数字差异。除此之外的任何事情都必须通过算法的某些未公开的步骤(例如RANSAC)或由于方程式非常有条件来解释。

相关问题