Nodes/comfyui_cv/CV Omnidir Undistort
ComfyUI Node

CV Omnidir Undistort

Re-projects an omnidirectional image (cv2.omnidir.undistortImage). Unlike the pinhole and fisheye undistorters there is no single 'undistorted' answer, because the source view is wider than a plane can hold: pick the PROJECTION. 'perspective' gives a normal photo of the middle and throws the rest away, 'cylindrical' and 'longitude-latitude' unroll the whole field into a panorama-style strip, and 'stereographic' keeps angles locally. The output camera matrix is derived from 'new_focal' for the perspective/stereographic modes; the two unrolled modes need the width/height-over-pi form instead, which 'auto' builds for you (a perspective-style K there gives a black or wildly cropped image, and cv2 does not complain).

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Omnidir Undistort
  • image
  • camera_matrix
  • dist_coeffs
  • view_rotation
  • image
  • new_camera_matrix
xi0.80
projectionRECTIFY_PERSPECTIVE
new_focal200
Categoryimage/CV/features

Inputs (7)

NameTypeDefaultDescription
imageCOMFY_MATCHTYPE_V3The omnidirectional image. Accepts a ComfyUI IMAGE/MASK directly (frame 0 of a batch) or an NPARRAY. Arithmetic ops (add, multiply, etc.) process the full IMAGE batch when both inputs have the same batch size.
camera_matrixNPARRAY3x3 K from 'Omnidir Calibrate'.
dist_coeffsNPARRAYFOUR omnidir coefficients (k1, k2, p1, p2).
xiFLOAT0.800–10CMei's mirror parameter from 'Omnidir Calibrate'.
projectionCOMBORECTIFY_PERSPECTIVERECTIFY_PERSPECTIVE: a flat photo of the centre. CYLINDRICAL / LONGLATI: the whole field unrolled. STEREOGRAPHIC: conformal, keeps local shapes.
new_focalFLOAT2000–10000Focal length of the output camera in pixels (perspective / stereographic only): smaller = wider view, more of the sphere squeezed in. 0 = auto (a quarter of the output width). Ignored by the two unrolled projections.
view_rotationoptNPARRAYWhere to AIM the output view: a 3x3 rotation (or a 3x1 Rodrigues vector) applied before the re-projection. Identity looks along the optical axis, which for a mirror rig is the middle of the reflection - anything near the rim gets cropped out of a perspective view, and this is the only way to point at it.

Outputs (2)

NameTypeDescription
imageCOMFY_MATCHTYPE_V3The re-projected image, same size as the input.
new_camera_matrixNPARRAYThe 3x3 K the output is expressed in.