Nodes/comfyui_cv/cv2.solvePnP
ComfyUI Node

cv2.solvePnP

Raw wrapper of cv2.solvePnP(objectPoints, imagePoints, cameraMatrix, distCoeffs, useExtrinsicGuess?, flags?). Parameters marked '?' are optional; blank means OpenCV default. See the OpenCV documentation for details.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
cv2.solvePnP
  • objectPoints
  • imagePoints
  • cameraMatrix
  • distCoeffs
  • retval
  • rvec
  • tvec
useExtrinsicGuessfalse
flagsSOLVEPNP_ITERATIVE
Categoryimage/CV/low-level/cv2 S

Inputs (6)

NameTypeDefaultDescription
objectPointsNPARRAYArray of object points in the object coordinate space, Nx3 1-channel or 1xN/Nx1 3-channel, where N is the number of points. vector\ can be also passed here. A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
imagePointsNPARRAYArray of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, where N is the number of points. vector\ can be also passed here. A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
cameraMatrixNPARRAYInput camera intrinsic matrix $\cameramatrix{A}$ . A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
distCoeffsoptNPARRAYInput vector of distortion coefficients $\distcoeffs$. If the vector is NULL/empty, the zero distortion coefficients are assumed. Optional - leave unconnected for the OpenCV default (None). A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
useExtrinsicGuessoptBOOLEANfalseParameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses the provided rvec and tvec values as initial approximations of the rotation and translation vectors, respectively, and further optimizes them. Preset to the OpenCV default (False).
flagsoptCOMBOSOLVEPNP_ITERATIVEMethod for solving a PnP problem: see More information about Perspective-n-Points is described in

Outputs (3)

NameTypeDescription
retvalBOOLEAN
rvecNPARRAY
tvecNPARRAY