Main Content

Camera Calibration

Calibrate single or stereo cameras and estimate camera intrinsics, extrinsics, and distortion parameters using pinhole and fisheye camera models

Camera calibration is the process of estimating camera parameters by using images that contain a calibration pattern. The parameters include camera intrinsics, distortion coefficients, and camera extrinsics. Use these camera parameters to remove lens distortion effects from an image, measure planar objects, reconstruct 3-D scenes from multiple cameras, and perform other computer vision applications.

Use the Camera Calibrator app and functions to estimate single camera intrinsics, extrinsics, and lens distortion parameters.

Use the Stereo Camera Calibrator app and functions to estimate the parameters and relative positions and orientations of both cameras in a stereo camera pair. You can then use the camera to recover depth from images. It also calculates the position and orientation of the second camera relative to the first camera.

Calibration patterns

Apps

Camera CalibratorEstimate geometric parameters of a single camera
Stereo Camera CalibratorEstimate geometric parameters of a stereo camera

Functions

expand all

detectCheckerboardPointsDetect checkerboard pattern in image
generateCheckerboardPointsGenerate checkerboard corner locations

Pinhole Camera

estimateCameraParametersCalibrate a single or stereo camera
estimateCameraMatrixEstimate camera projection matrix from world-to-image point correspondences

Fisheye Camera

estimateFisheyeParametersCalibrate fisheye camera

Stereo Camera

estimateStereoBaselineEstimate baseline of stereo camera

Single Camera

cameraParametersObject for storing camera parameters
cameraIntrinsics Object for storing intrinsic camera parameters
cameraMatrixCamera projection matrix

Fisheye Camera

fisheyeIntrinsicsObject for storing intrinsic fisheye camera parameters
fisheyeParametersObject for storing fisheye camera parameters

Stereo Camera

stereoParametersObject for storing stereo camera system parameters

Error Metrics

cameraCalibrationErrorsObject for storing standard errors of estimated camera parameters
intrinsicsEstimationErrorsObject for storing standard errors of estimated camera intrinsics and distortion coefficients
extrinsicsEstimationErrorsObject for storing standard errors of estimated camera extrinsics
stereoCalibrationErrorsObject for storing standard errors of estimated stereo parameters
fisheyeCalibrationErrorsObject for storing standard errors of estimated fisheye camera parameters
fisheyeIntrinsicsEstimationErrorsObject for storing standard errors of estimated fisheye camera intrinsics

Pinhole Camera

undistortImageCorrect image for lens distortion
undistortPointsCorrect point coordinates for lens distortion

Fisheye Camera

undistortFisheyeImageCorrect fisheye image for lens distortion
undistortFisheyePointsCorrect point coordinates for fisheye lens distortion
pcshowPlot 3-D point cloud
plotCameraPlot a camera in 3-D coordinates
showExtrinsicsVisualize extrinsic camera parameters
showReprojectionErrorsVisualize calibration errors
stereoAnaglyphCreate red-cyan anaglyph from stereo pair of images
extrinsicsCompute location of calibrated camera
extrinsicsToCameraPoseConvert extrinsics to camera pose
cameraPoseToExtrinsicsConvert camera pose to extrinsics
relativeCameraPoseCompute relative rotation and translation between camera poses
rotationMatrixToVectorConvert 3-D rotation matrix to rotation vector
rotationVectorToMatrixConvert 3-D rotation vector to rotation matrix

Topics

Fisheye Calibration Basics

Fisheye camera model and calibration in MATLAB

What Is Camera Calibration?

Estimate the parameters of a lens and image sensor of an image or video camera.

Coordinate Systems

Specify pixel Indices, spatial coordinates, and 3-D coordinate systems

Single Camera Calibrator App

Estimate camera intrinsics, extrinsics, and lens distortion parameters.

Stereo Camera Calibrator App

Calibrate a stereo camera, which you can then use to recover depth from images.

Point Feature Types

Choose functions that return and accept points objects for several types of features

Featured Examples