| Cv2CalibrateCamera Method (IEnumerableMat, IEnumerableMat, Size, InputOutputArray, InputOutputArray, Mat, Mat, CalibrationFlags, NullableTermCriteria) |
finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax public static double CalibrateCamera(
IEnumerable<Mat> objectPoints,
IEnumerable<Mat> imagePoints,
Size imageSize,
InputOutputArray cameraMatrix,
InputOutputArray distCoeffs,
out Mat[] rvecs,
out Mat[] tvecs,
CalibrationFlags flags = CalibrationFlags.None,
Nullable<TermCriteria> criteria = null
)
Public Shared Function CalibrateCamera (
objectPoints As IEnumerable(Of Mat),
imagePoints As IEnumerable(Of Mat),
imageSize As Size,
cameraMatrix As InputOutputArray,
distCoeffs As InputOutputArray,
<OutAttribute> ByRef rvecs As Mat(),
<OutAttribute> ByRef tvecs As Mat(),
Optional flags As CalibrationFlags = CalibrationFlags.None,
Optional criteria As Nullable(Of TermCriteria) = Nothing
) As Double
public:
static double CalibrateCamera(
IEnumerable<Mat^>^ objectPoints,
IEnumerable<Mat^>^ imagePoints,
Size imageSize,
InputOutputArray^ cameraMatrix,
InputOutputArray^ distCoeffs,
[OutAttribute] array<Mat^>^% rvecs,
[OutAttribute] array<Mat^>^% tvecs,
CalibrationFlags flags = CalibrationFlags::None,
Nullable<TermCriteria> criteria = nullptr
)
static member CalibrateCamera :
objectPoints : IEnumerable<Mat> *
imagePoints : IEnumerable<Mat> *
imageSize : Size *
cameraMatrix : InputOutputArray *
distCoeffs : InputOutputArray *
rvecs : Mat[] byref *
tvecs : Mat[] byref *
?flags : CalibrationFlags *
?criteria : Nullable<TermCriteria>
(* Defaults:
let _flags = defaultArg flags CalibrationFlags.None
let _criteria = defaultArg criteria null
*)
-> float
Parameters
- objectPoints
- Type: System.Collections.GenericIEnumerableMat
In the new interface it is a vector of vectors of calibration pattern points in the calibration pattern coordinate space.
The outer vector contains as many elements as the number of the pattern views. If the same calibration pattern is shown in each view and
it is fully visible, all the vectors will be the same. Although, it is possible to use partially occluded patterns, or even different patterns
in different views. Then, the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, then,
if the rig is planar, it may make sense to put the model to a XY coordinate plane so that Z-coordinate of each input object point is 0.
In the old interface all the vectors of object points from different views are concatenated together. - imagePoints
- Type: System.Collections.GenericIEnumerableMat
In the new interface it is a vector of vectors of the projections of calibration pattern points.
imagePoints.Count() and objectPoints.Count() and imagePoints[i].Count() must be equal to objectPoints[i].Count() for each i. - imageSize
- Type: OpenCvSharpSize
Size of the image used only to initialize the intrinsic camera matrix. - cameraMatrix
- Type: OpenCvSharpInputOutputArray
Output 3x3 floating-point camera matrix.
If CV_CALIB_USE_INTRINSIC_GUESS and/or CV_CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
initialized before calling the function. - distCoeffs
- Type: OpenCvSharpInputOutputArray
Output 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. - rvecs
- Type: OpenCvSharpMat
Output vector of rotation vectors (see Rodrigues() ) estimated for each pattern view. That is, each k-th rotation vector
together with the corresponding k-th translation vector (see the next output parameter description) brings the calibration pattern
from the model coordinate space (in which object points are specified) to the world coordinate space, that is, a real position of the
calibration pattern in the k-th pattern view (k=0.. M -1) - tvecs
- Type: OpenCvSharpMat
Output vector of translation vectors estimated for each pattern view. - flags (Optional)
- Type: OpenCvSharpCalibrationFlags
Different flags that may be zero or a combination of the CalibrationFlag values - criteria (Optional)
- Type: SystemNullableTermCriteria
Termination criteria for the iterative optimization algorithm.
Return Value
Type:
Double[Missing <returns> documentation for "M:OpenCvSharp.Cv2.CalibrateCamera(System.Collections.Generic.IEnumerable{OpenCvSharp.Mat},System.Collections.Generic.IEnumerable{OpenCvSharp.Mat},OpenCvSharp.Size,OpenCvSharp.InputOutputArray,OpenCvSharp.InputOutputArray,OpenCvSharp.Mat[]@,OpenCvSharp.Mat[]@,OpenCvSharp.CalibrationFlags,System.Nullable{OpenCvSharp.TermCriteria})"]
See Also