Cv2SolvePnP Method (IEnumerablePoint3f, IEnumerablePoint2f, Double, IEnumerableDouble, Double, Double, Boolean, SolvePnPFlags)
|
Finds an object pose from 3D-2D point correspondences.
Namespace:
OpenCvSharp
Assembly:
OpenCvSharp (in OpenCvSharp.dll) Version: 3.4.1.20180605-33-CaRLSharp
Syntaxpublic static void SolvePnP(
IEnumerable<Point3f> objectPoints,
IEnumerable<Point2f> imagePoints,
double[,] cameraMatrix,
IEnumerable<double> distCoeffs,
out double[] rvec,
out double[] tvec,
bool useExtrinsicGuess = false,
SolvePnPFlags flags = SolvePnPFlags.Iterative
)
Public Shared Sub SolvePnP (
objectPoints As IEnumerable(Of Point3f),
imagePoints As IEnumerable(Of Point2f),
cameraMatrix As Double(,),
distCoeffs As IEnumerable(Of Double),
<OutAttribute> ByRef rvec As Double(),
<OutAttribute> ByRef tvec As Double(),
Optional useExtrinsicGuess As Boolean = false,
Optional flags As SolvePnPFlags = SolvePnPFlags.Iterative
)
public:
static void SolvePnP(
IEnumerable<Point3f>^ objectPoints,
IEnumerable<Point2f>^ imagePoints,
array<double,2>^ cameraMatrix,
IEnumerable<double>^ distCoeffs,
[OutAttribute] array<double>^% rvec,
[OutAttribute] array<double>^% tvec,
bool useExtrinsicGuess = false,
SolvePnPFlags flags = SolvePnPFlags::Iterative
)
static member SolvePnP :
objectPoints : IEnumerable<Point3f> *
imagePoints : IEnumerable<Point2f> *
cameraMatrix : float[,] *
distCoeffs : IEnumerable<float> *
rvec : float[] byref *
tvec : float[] byref *
?useExtrinsicGuess : bool *
?flags : SolvePnPFlags
(* Defaults:
let _useExtrinsicGuess = defaultArg useExtrinsicGuess false
let _flags = defaultArg flags SolvePnPFlags.Iterative
*)
-> unit
OpenCvSharp.Cv2.SolvePnP = function(objectPoints, imagePoints, cameraMatrix, distCoeffs, rvec, tvec, useExtrinsicGuess, flags);
Parameters
- objectPoints
- Type: System.Collections.GenericIEnumerablePoint3f
Array of object points in the object coordinate space, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel,
where N is the number of points. vector<Point3f> can be also passed here. - imagePoints
- Type: System.Collections.GenericIEnumerablePoint2f
Array of corresponding image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel,
where N is the number of points. vector<Point2f> can be also passed here. - cameraMatrix
- Type: SystemDouble
Input camera matrix - distCoeffs
- Type: System.Collections.GenericIEnumerableDouble
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 vector is null, the zero distortion coefficients are assumed. - rvec
- Type: SystemDouble
Output rotation vector that, together with tvec , brings points from the model coordinate system to the
camera coordinate system. - tvec
- Type: SystemDouble
Output translation vector. - useExtrinsicGuess (Optional)
- Type: SystemBoolean
If true, the function uses the provided rvec and tvec values as initial approximations of
the rotation and translation vectors, respectively, and further optimizes them. - flags (Optional)
- Type: OpenCvSharpSolvePnPFlags
Method for solving a PnP problem:
See Also