Cv2.GetOptimalNewCameraMatrix Method (Double[,],Double[], Size, Double, Size, Rect, Boolean)
|
Returns the new camera matrix based on the free scaling parameter.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 3.4.1.20180605-33-CaRLSharp
Syntaxpublic static double[,] GetOptimalNewCameraMatrix(
double[,] cameraMatrix,
double[] distCoeffs,
Size imageSize,
double alpha,
Size newImgSize,
out Rect validPixROI,
bool centerPrincipalPoint = false
)
Public Shared Function GetOptimalNewCameraMatrix (
cameraMatrix As Double(,),
distCoeffs As Double(),
imageSize As Size,
alpha As Double,
newImgSize As Size,
<OutAttribute> ByRef validPixROI As Rect,
Optional centerPrincipalPoint As Boolean = false
) As Double(,)
public:
static array<double,2>^ GetOptimalNewCameraMatrix(
array<double,2>^ cameraMatrix,
array<double>^ distCoeffs,
Size imageSize,
double alpha,
Size newImgSize,
[OutAttribute] Rect% validPixROI,
bool centerPrincipalPoint = false
)
static member GetOptimalNewCameraMatrix :
cameraMatrix : float[,] *
distCoeffs : float[] *
imageSize : Size *
alpha : float *
newImgSize : Size *
validPixROI : Rect byref *
?centerPrincipalPoint : bool
(* Defaults:
let _centerPrincipalPoint = defaultArg centerPrincipalPoint false
*)
-> float[,]
OpenCvSharp.Cv2.GetOptimalNewCameraMatrix = function(cameraMatrix, distCoeffs, imageSize, alpha, newImgSize, validPixROI, centerPrincipalPoint);
Parameters
- cameraMatrix
- Type:System.Double[,]
Input camera matrix. - distCoeffs
- Type:System.Double[]
Input vector of distortion coefficients (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements.
If the array is null, the zero distortion coefficients are assumed. - imageSize
- Type: OpenCvSharp.Size
Original image size. - alpha
- Type: System.Double
Free scaling parameter between 0 (when all the pixels in the undistorted image are valid)
and 1 (when all the source image pixels are retained in the undistorted image). - newImgSize
- Type: OpenCvSharp.Size
Image size after rectification. By default,it is set to imageSize . - validPixROI
- Type: OpenCvSharp.Rect
Optional output rectangle that outlines all-good-pixels region in the undistorted image. See roi1, roi2 description in stereoRectify() . - centerPrincipalPoint (Optional)
- Type: System.Boolean
Optional flag that indicates whether in the new camera matrix the principal point
should be at the image center or not. By default, the principal point is chosen to best fit a
subset of the source image (determined by alpha) to the corrected image.
Return Value
Type:
Double[,]optimal new camera matrix
See Also