5.4 Calculating calibration coefficients
After the checkerboard corners have been detected and (if specified) undistortion coefficients estimated, the function will begin estimating the DLT (calibration) coefficients. Because the estimation process does not always converge on the correct solution, the function divides up the detected corners into different sets and run separate calibrations for each set. It then saves the calibration with the lowest error. The number of sets that are created by default depends on the number of detected sets. The parameters that control this are:
- num.sample.est: the number of aspects in the pool of images that will be used to estimate the coefficients
- num.sample.sets: the number of unique sets that will be tried
- num.aspects.sample: the number of aspects in each set that will actually be used to estimate the coefficients
The function prints these parameters before the estimation step. The parameter values used in the previous examples of calibration from photographs and from video should work well for most cases but you can adjust these parameters if needed.
To estimate the DLT coefficients, calibrateCameras() uses an optimization routine that sequentially adds each checkerboard aspect (all views of a checkerboard in a particular position). As the number of parameters increases, the number of aspects increases and the optimization will take progressively more time up to the maximum number of aspects. For this reason, num.aspects.sample should not be greater than 9. Adding more aspects after 9 does not generally cause any further increase in accuracy.