Nodes/comfyui_cv/CV Fisheye Calibrate (Chessboard)
ComfyUI Node

CV Fisheye Calibrate (Chessboard)

Calibrates a WIDE-ANGLE lens with the equidistant fisheye model (cv2.fisheye.calibrate) instead of the Brown-Conrady model 'Calibrate Camera' uses. Same input: a batch of chessboard views from different angles, corner-detected and refined to sub-pixel here. The output 'dist_coeffs' is FOUR coefficients (k1..k4), not five, and only the fisheye nodes accept it - feeding it to cv2.undistort is silently wrong. Keep CALIB_RECOMPUTE_EXTRINSIC on: without it the shipped example calibrates to 99 px RMS and a focal length 20% off instead of 0.13 px. Failure tolerant: fewer than 3 usable views, or a view set cv2 finds ill-conditioned, returns found=false with an identity matrix and zero distortion.

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Fisheye Calibrate (Chessboard)
  • images
  • camera_matrix
  • dist_coeffs
  • rms_error
  • views_used
  • found
pattern_cols9
pattern_rows6
flagsnone (0) | CALIB_RECOMPUTE_EXTRINSIC | CALIB_FIX_SKEW
square_size1.00
Categoryimage/CV/features

Inputs (5)

NameTypeDefaultDescription
imagesIMAGEBatch of chessboard views from different angles (>= 3 usable; ~8-20 gives a good fit). Fill the frame, but note that boards pushed right into the corners can make the solver's initialisation fail.
pattern_colsINT92–40Inner corners per row (squares per row minus 1).
pattern_rowsINT62–40Inner corners per column (squares per column minus 1).
flagsSTRINGnone (0) | CALIB_RECOMPUTE_EXTRINSIC | CALIB_FIX_SKEWSolver options, OR-ed. RECOMPUTE_EXTRINSIC re-estimates each view's pose between intrinsic steps and is what makes the fit converge; FIX_SKEW pins alpha to 0 (what a real lens does); CHECK_COND makes cv2 REJECT ill-conditioned views by throwing, which this node reports as found=false; FIX_K1..K4 hold single distortion terms.
square_sizeoptFLOAT1.000.0001–1000000Physical size of one square (e.g. mm); sets the world scale. Leave 1.0 for relative calibration.

Outputs (5)

NameTypeDescription
camera_matrixNPARRAY3x3 intrinsic matrix K (fx, fy, cx, cy).
dist_coeffsNPARRAYFOUR fisheye coefficients (k1, k2, k3, k4) as 4x1. Only 'Fisheye Undistort' and the other cv2.fisheye entry points understand them.
rms_errorFLOATMean reprojection error in pixels; under ~1 is good.
views_usedINTNumber of input views with a detectable board.
foundBOOLEAN