TensorMath.solvePnP
FunctionEstimates the object pose given a set of object points (inObjectPoints), their corresponding image projections (inImagePoints), and the intrinsic camera matr…
- Available on all platforms
solvePnP(
inObjectPoints,inImagePoints,imagePointsShape,transform,flags,outRotTrans):boolean
Estimates the object pose given a set of object points (inObjectPoints), their corresponding image projections (inImagePoints), and the intrinsic camera matrix (transform).
inObjectPoints - Float32Array of size (point count * 3). 3D points of the object
inImagePoints - Float32Array of size (point count * 2). 2D points which are projections of the points in inObjectPoints, with some applied transformation we are attempting to find
imagePointsShape - Should be {2, point count, 1}
transform - Intrinsic camera matrix
flags - Currently unused, can be left as 0. Further functionality may be added in the future.
outRotTrans - Float32Array of size 6 where results are written. Describes object transformation:
vec3(outRotTrans[0], outRotTrans[1], outRotTrans[2]) - object rotation in Rodrigues format
vec3(outRotTrans[3], outRotTrans[4], outRotTrans[5]) - object position in 3D space
Parameters
| Parameter | Type |
|---|---|
inObjectPoints | Float32Array |
inImagePoints | Float32Array |
imagePointsShape | vec3 |
transform | mat3 |
flags | number |
outRotTrans | Float32Array |
Returns
boolean