cv.getOptimalNewCameraMatrix - MATLAB File Help
cv.getOptimalNewCameraMatrix

Returns the new camera matrix based on the free scaling parameter

cameraMatrix = cv.getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize)
[cameraMatrix, validPixROI] = cv.getOptimalNewCameraMatrix(...)
[...] = cv.getOptimalNewCameraMatrix(..., 'OptionName', optionValue, ...)

Input

Output

Options

The function computes and returns the optimal new camera matrix based on the free scaling parameter. By varying this parameter, you may retrieve only sensible pixels Alpha=0, keep all the original image pixels if there is valuable information in the corners Alpha=1, or get something in between. When Alpha>0, the undistorted result is likely to have some black pixels corresponding to "virtual" pixels outside of the captured distorted image. The original camera matrix, distortion coefficients, the computed new camera matrix, and newImageSize should be passed to cv.initUndistortRectifyMap to produce the maps for cv.remap.

See also