Nodes/comfyui_cv/cv2.stereoRectify
ComfyUI Node

cv2.stereoRectify

Raw wrapper of cv2.stereoRectify(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, flags?, alpha?, newImageSize?). 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.stereoRectify
  • cameraMatrix1
  • distCoeffs1
  • cameraMatrix2
  • distCoeffs2
  • imageSize
  • R
  • T
  • newImageSize
  • R1
  • R2
  • P1
  • P2
  • Q
  • roi1
  • roi2
flagsCALIB_ZERO_DISPARITY
alpha-1.0000
Categoryimage/CV/low-level/cv2 S

Inputs (10)

NameTypeDefaultDescription
cameraMatrix1NPARRAY - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
distCoeffs1NPARRAY - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
cameraMatrix2NPARRAY - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
distCoeffs2NPARRAY - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
imageSizeCV_TUPLE0,0Size of the image used for stereo calibration. One value with 2 components (w, h) - it travels as a whole, so it cannot arrive half-connected. Wire it from 'CV Tuple' or type the components in place.
RNPARRAYRotation matrix between the coordinate systems of the first and the second cameras. A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
TNPARRAY - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here.
flagsoptCOMBOCALIB_ZERO_DISPARITYOperation flags that may be zero or . If the flag is set, the function makes the principal points of each camera have the same pixel coordinates in the rectified views. And if the flag is not set, the function may still shift the images in the horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the useful image area.
alphaoptFLOAT-1.0000-1e+38–1e+38 - - - Preset to the OpenCV default (-1.0).
newImageSizeoptCV_TUPLE0,0New image resolution after rectification. The same size should be passed to #initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) is passed (default), it is set to the original imageSize . Setting it to larger value can help you preserve details in the original image, especially when there is a big radial distortion. One value with 2 components (w, h) - it travels as a whole, so it cannot arrive half-connected. Wire it from 'CV Tuple' or type the components in place.

Outputs (7)

NameTypeDescription
R1NPARRAY
R2NPARRAY
P1NPARRAY
P2NPARRAY
QNPARRAY
roi1BOUNDING_BOXTranslation vector between coordinate systems of the cameras. A cv2 Rect as core BOUNDING_BOX data ({x, y, width, height}, nested one group per frame) - feed 'Crop By Bounding Boxes', 'Draw BBoxes', or 'CV Split Tuple' for x/y/w/h.
roi2BOUNDING_BOXTranslation vector between coordinate systems of the cameras. A cv2 Rect as core BOUNDING_BOX data ({x, y, width, height}, nested one group per frame) - feed 'Crop By Bounding Boxes', 'Draw BBoxes', or 'CV Split Tuple' for x/y/w/h.