Nodes/comfyui_cv/CV Omnidir Stereo Reconstruct
ComfyUI Node

CV Omnidir Stereo Reconstruct

Rectifies an omnidirectional stereo pair, matches it with SGBM and back-projects the result (cv2.omnidir.stereoReconstruct) - the whole depth pipeline in one call, because the rectification of a catadioptric pair is not a homography and cannot be wired from the pinhole nodes. Feed both cameras' K, xi and 4-coefficient D plus the R and T between them. The disparity is expressed in the RECTIFIED frame, so compare it against 'left_rectified', not the input. Invalid pixels come back as -1 from cv2; this node writes 0 there and gives you a 'valid' mask instead. Failure tolerant: a cv2 error returns empty outputs with found=false.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Omnidir Stereo Reconstruct
  • left
  • right
  • K_left
  • dist_left
  • K_right
  • dist_right
  • R
  • T
  • disparity
  • valid
  • left_rectified
  • right_rectified
  • point_cloud
  • found
xi_left0.80
xi_right0.80
projectionRECTIFY_PERSPECTIVE
num_disparities64
block_size7
Categoryimage/CV/features

Inputs (13)

NameTypeDefaultDescription
leftIMAGELeft omnidirectional image.
rightIMAGERight omnidirectional image.
K_leftNPARRAY3x3 K of the left camera.
dist_leftNPARRAYFour omnidir coefficients of the left camera.
xi_leftFLOAT0.800–10Left mirror parameter.
K_rightNPARRAY3x3 K of the right camera.
dist_rightNPARRAYFour omnidir coefficients of the right camera.
xi_rightFLOAT0.800–10Right mirror parameter.
RNPARRAY3x3 rotation from the left to the right camera.
TNPARRAY3x1 translation from the left to the right camera. Its length sets the world scale of the cloud.
projectionCOMBORECTIFY_PERSPECTIVERectification the matcher runs in. PERSPECTIVE keeps the middle of the field at higher resolution; LONGLATI unrolls the whole sphere and matches more of it, at lower resolution per pixel. cv2 accepts only these two here.
num_disparitiesINT6416–512SGBM search range, must be a multiple of 16. It sets the NEAREST distance the pair can see.
block_sizeINT73–51SGBM matching window (odd). Larger = smoother and blinder to detail.

Outputs (6)

NameTypeDescription
disparityNPARRAYFloat32 disparity in the RECTIFIED frame; 0 where nothing matched (cv2 writes -1 there).
validNPARRAYUint8 mask, 255 where the disparity is real.
left_rectifiedIMAGEThe rectified left image - the frame the disparity and the cloud are aligned with.
right_rectifiedIMAGEThe rectified right image.
point_cloudNPARRAYNx3 float32 cloud in the left camera's frame, in the units of T. Feed 'CV Filter Point Cloud' or 'CV Point Cloud Normals'.
foundBOOLEAN