[−][src]Function opencv::calib3d::get_default_new_camera_matrix
pub fn get_default_new_camera_matrix(
camera_matrix: &dyn ToInputArray,
imgsize: Size,
center_principal_point: bool
) -> Result<Mat>
Returns the default new camera matrix.
The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true).
In the latter case, the new camera matrix will be:
where and are and elements of cameraMatrix, respectively.
By default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not move the principal point. However, when you work with stereo, it is important to move the principal points in both views to the same y-coordinate (which is required by most of stereo correspondence algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for each view where the principal points are located at the center.
Parameters
- cameraMatrix: Input camera matrix.
- imgsize: Camera view image size in pixels.
- centerPrincipalPoint: Location of the principal point in the new camera matrix. The parameter indicates whether this location should be at the image center or not.
C++ default parameters
- imgsize: Size()
- center_principal_point: false