Main Content

stereoCalibrationErrors

Object for storing standard errors of estimated stereo parameters

Description

The stereoCalibrationErrors object contains the standard errors of the estimated calibration parameters of a pair of stereo cameras. The object stores the estimated intrinsic parameters for camera one and camera two, the extrinsic parameters for camera one, and the rotation and translation of camera two relative to camera one. You can access the standard error values by using the object properties. To display the standard errors, use the displayErrors object function.

Creation

Create a stereo camera calibration errors object by using the estimateCameraParameters function to calibrate a pair of stereo cameras. The stereoCalibrationErrors object is the third output argument of the estimateCameraParameters function. For example:

[params,imgsUsed,Errors] = estimateCameraParameters(imagePoints,worldPoints)

Properties

expand all

Standard errors of estimated intrinsic parameters and distortion coefficients for camera one, specified as an intrinsicsEstimationErrors object.

Standard errors of estimated extrinsic parameters and distortion coefficients for camera one, specified as an extrinsicsEstimationErrors object.

Standard errors of estimated intrinsic parameters and distortion coefficients for camera two, specified as an intrinsicsEstimationErrors object.

Standard errors of the rotated vector of camera two relative to camera one, specified as a three-element vector.

Standard errors of the translation of camera two relative to camera one, specified as a three-element vector.

Object Functions

displayErrorsDisplay standard errors of stereo camera parameter estimation

Examples

collapse all

Specify two sets of calibration images.

imageDir = fullfile(toolboxdir("vision"),"visiondata", ...
  "calibration","stereo");
leftImages = imageDatastore(fullfile(imageDir,"left"));
rightImages = imageDatastore(fullfile(imageDir,"right"));

Detect the checkerboards.

[imagePoints,boardSize] = detectCheckerboardPoints( ...
  leftImages.Files,rightImages.Files);

Generate the world coordinates of the corners of the squares. Square size is in millimeters.

squareSize = 108;
worldPoints = generateCheckerboardPoints(boardSize,squareSize);

Calibrate the stereo camera system. Here, both cameras have the same resolution.

I = readimage(leftImages,1); 
imageSize = [size(I,1) size(I,2)];
[params, ~, errors] = estimateCameraParameters(imagePoints,worldPoints, ...
                                  ImageSize=imageSize);

Display standard stereo calibration errors.

displayErrors(errors,params);
			Standard Errors of Estimated Stereo Camera Parameters
			-----------------------------------------------------

Camera 1 Intrinsics
-------------------
Focal length (pixels):   [ 1038.0284 +/- 0.6533     1037.9143 +/- 0.6389  ]
Principal point (pixels):[  656.0840 +/- 0.3408      485.5485 +/- 0.2639  ]
Radial distortion:       [   -0.3617 +/- 0.0008        0.1866 +/- 0.0026  ]

Camera 1 Extrinsics
-------------------
Rotation vectors:
                         [    0.1680 +/- 0.0007       -0.0271 +/- 0.0006        3.1125 +/- 0.0001  ]
                         [    0.1995 +/- 0.0006       -0.0523 +/- 0.0005       -3.0991 +/- 0.0000  ]
                         [    0.4187 +/- 0.0005       -0.1061 +/- 0.0004       -3.1113 +/- 0.0001  ]
                         [    0.5239 +/- 0.0005       -0.0604 +/- 0.0004       -3.0552 +/- 0.0001  ]
                         [    0.6807 +/- 0.0006       -0.0306 +/- 0.0005       -3.0331 +/- 0.0001  ]
                         [    0.3513 +/- 0.0007       -0.0993 +/- 0.0006       -3.0334 +/- 0.0001  ]
                         [    0.0212 +/- 0.0007       -0.1179 +/- 0.0007       -3.0833 +/- 0.0000  ]
                         [   -0.2765 +/- 0.0008       -0.0847 +/- 0.0007       -3.0943 +/- 0.0001  ]
                         [   -0.4407 +/- 0.0007       -0.1119 +/- 0.0006       -3.0652 +/- 0.0001  ]
                         [   -0.2537 +/- 0.0008       -0.1334 +/- 0.0007       -3.1039 +/- 0.0001  ]

Translation vectors (mm):
                         [  708.4193 +/- 0.4914      227.0501 +/- 0.4002     1492.8670 +/- 1.0127  ]
                         [  368.4410 +/- 0.5228      191.7201 +/- 0.4094     1589.9144 +/- 0.9987  ]
                         [  226.3711 +/- 0.5173      191.1430 +/- 0.4030     1578.4777 +/- 0.9576  ]
                         [   49.5378 +/- 0.5183      196.7496 +/- 0.4030     1580.5402 +/- 0.9493  ]
                         [ -172.4000 +/- 0.7003      150.9911 +/- 0.5406     2119.3251 +/- 1.2532  ]
                         [   10.7778 +/- 0.6784      176.8786 +/- 0.5276     2066.8341 +/- 1.2907  ]
                         [  295.4841 +/- 0.6616      167.8676 +/- 0.5158     2010.7710 +/- 1.2738  ]
                         [  614.2340 +/- 0.6457      166.2017 +/- 0.5153     1968.1795 +/- 1.2722  ]
                         [  767.0158 +/- 0.6106      165.5373 +/- 0.4991     1868.3331 +/- 1.2395  ]
                         [  953.8135 +/- 0.7336      -14.7980 +/- 0.6039     2255.6166 +/- 1.5107  ]

Camera 2 Intrinsics
-------------------
Focal length (pixels):   [ 1042.4815 +/- 0.6644     1042.2690 +/- 0.6534  ]
Principal point (pixels):[  640.5974 +/- 0.3305      479.0652 +/- 0.2633  ]
Radial distortion:       [   -0.3614 +/- 0.0007        0.1822 +/- 0.0022  ]

Position And Orientation of Camera 2 Relative to Camera 1
---------------------------------------------------------
Rotation of camera 2:         [   -0.0037 +/- 0.0002        0.0050 +/- 0.0004       -0.0002 +/- 0.0000  ]
Translation of camera 2 (mm): [ -119.8720 +/- 0.0401       -0.4005 +/- 0.0414       -0.0258 +/- 0.1750  ]

Version History

Introduced in R2014b