Cv2CalibrateCamera Method (IEnumerableIEnumerablePoint3f, IEnumerableIEnumerablePoint2f, Size, Double, Double, Vec3d, Vec3d, CalibrationFlag, NullableTermCriteria) OpenCvSharp Class Library
finds intrinsic and extrinsic camera parameters from several fews of a known calibration pattern.

Namespace:  OpenCvSharp.CPlusPlus
Assembly:  OpenCvSharp.CPlusPlus (in OpenCvSharp.CPlusPlus.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static double CalibrateCamera(
	IEnumerable<IEnumerable<Point3f>> objectPoints,
	IEnumerable<IEnumerable<Point2f>> imagePoints,
	Size imageSize,
	double[,] cameraMatrix,
	double[] distCoeffs,
	out Vec3d[] rvecs,
	out Vec3d[] tvecs,
	CalibrationFlag flags = CalibrationFlag.Zero,
	Nullable<TermCriteria> criteria = null
)

Parameters

objectPoints
Type: System.Collections.GenericIEnumerableIEnumerablePoint3f
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.GenericIEnumerableIEnumerablePoint2f
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: OpenCvSharp.CPlusPlusSize
Size of the image used only to initialize the intrinsic camera matrix.
cameraMatrix
Type: SystemDouble
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: SystemDouble
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: OpenCvSharp.CPlusPlusVec3d
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: OpenCvSharp.CPlusPlusVec3d
Output vector of translation vectors estimated for each pattern view.
flags (Optional)
Type: OpenCvSharpCalibrationFlag
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.CPlusPlus.Cv2.CalibrateCamera(System.Collections.Generic.IEnumerable{System.Collections.Generic.IEnumerable{OpenCvSharp.CPlusPlus.Point3f}},System.Collections.Generic.IEnumerable{System.Collections.Generic.IEnumerable{OpenCvSharp.CPlusPlus.Point2f}},OpenCvSharp.CPlusPlus.Size,System.Double[0:,0:],System.Double[],OpenCvSharp.CPlusPlus.Vec3d[]@,OpenCvSharp.CPlusPlus.Vec3d[]@,OpenCvSharp.CalibrationFlag,System.Nullable{OpenCvSharp.CPlusPlus.TermCriteria})"]

See Also

Reference