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.
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)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Batch 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_cols | INT | 92–40 | Inner corners per row (squares per row minus 1). |
| pattern_rows | INT | 62–40 | Inner corners per column (squares per column minus 1). |
| flags | STRING | none (0) | CALIB_RECOMPUTE_EXTRINSIC | CALIB_FIX_SKEW | Solver 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_sizeopt | FLOAT | 1.000.0001–1000000 | Physical size of one square (e.g. mm); sets the world scale. Leave 1.0 for relative calibration. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| camera_matrix | NPARRAY | 3x3 intrinsic matrix K (fx, fy, cx, cy). |
| dist_coeffs | NPARRAY | FOUR fisheye coefficients (k1, k2, k3, k4) as 4x1. Only 'Fisheye Undistort' and the other cv2.fisheye entry points understand them. |
| rms_error | FLOAT | Mean reprojection error in pixels; under ~1 is good. |
| views_used | INT | Number of input views with a detectable board. |
| found | BOOLEAN | — |