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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| cameraMatrix1 | NPARRAY | - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| distCoeffs1 | NPARRAY | - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| cameraMatrix2 | NPARRAY | - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| distCoeffs2 | NPARRAY | - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| imageSize | CV_TUPLE | 0,0 | Size 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. |
| R | NPARRAY | Rotation 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. | |
| T | NPARRAY | - - - A data array (points / matrix), NOT an image - only an NPARRAY link is accepted here. | |
| flagsopt | COMBO | CALIB_ZERO_DISPARITY | Operation 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. |
| alphaopt | FLOAT | -1.0000-1e+38–1e+38 | - - - Preset to the OpenCV default (-1.0). |
| newImageSizeopt | CV_TUPLE | 0,0 | New 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)
| Name | Type | Description |
|---|---|---|
| R1 | NPARRAY | — |
| R2 | NPARRAY | — |
| P1 | NPARRAY | — |
| P2 | NPARRAY | — |
| Q | NPARRAY | — |
| roi1 | BOUNDING_BOX | Translation 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. |
| roi2 | BOUNDING_BOX | Translation 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. |