Skip to main content

TensorMath.solvePnPRansac

Function

solvePnPRansac is very similar to solvePnPExtended except that it uses Random Sample Consensus ( RANSAC ) for robustly estimating the pose.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

solvePnPRansac(inObjectPoints, inImagePoints, imagePointsShape, cameraIntrinsicsMatrix, distortionCoeff, distortionCoeffShape, useExtrinsicGuess, iterationsCount, reprojectionError, confidence, flags, outInliers, outRotTrans): boolean

solvePnPRansac is very similar to solvePnPExtended except that it uses Random Sample Consensus ( RANSAC ) for robustly estimating the pose.

iterationsCount - The number of times the minimum number of points are picked and the parameters estimated

reprojectionError - As mentioned earlier in RANSAC the points for which the predictions are close enough are called “inliers”. This parameter value is the maximum allowed distance between the observed and computed point projections to consider it an inlier.

confidence - Number of inliers. If the algorithm at some stage finds more inliers than confidence, it finishes. outInliers - Output array that contains indices of inliers in objectPoints and imagePoints . outRotTrans

Parameters

ParameterType
inObjectPointsFloat32Array
inImagePointsFloat32Array
imagePointsShapevec3
cameraIntrinsicsMatrixmat3
distortionCoeffFloat32Array
distortionCoeffShapevec3
useExtrinsicGuessboolean
iterationsCountnumber
reprojectionErrornumber
confidencenumber
flagsnumber
outInliersUint8Array
outRotTransFloat32Array

Returns

boolean