Nodes/comfyui_cv/CV Calibrate Camera (Circle Grid)
ComfyUI Node

CV Calibrate Camera (Circle Grid)

Estimates a camera's intrinsics and lens distortion from several circle-grid views (cv2.calibrateCamera). Calibration needs per-view 2D/3D correspondences accumulated across images, which the raw wrappers can't express, so this node manages it exactly like the chessboard 'Calibrate Camera': feed an IMAGE BATCH of circle-grid photos from DIFFERENT angles; each is grayscaled, its circle centers are found with cv2.findCirclesGrid and matched to planar object points built from pattern size x square_size. Views where the grid is not found are skipped. The 'asymmetric (staggered)' layout is the usual choice - it is the OpenCV-recommended calibration target for wide-angle and stereo rigs, since the staggered rows break the 180-degree ambiguity that plagues symmetric grids. Failure-tolerant: with fewer than 3 usable views it returns found=false, an identity matrix and zero distortion. Feed camera_matrix + dist_coeffs into cv2.undistort, or into 'Stereo Calibrate (Circle Grid)' as initial guesses; rms_error (px) reports fit quality (under ~1 is good).

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Calibrate Camera (Circle Grid)
  • images
  • camera_matrix
  • dist_coeffs
  • rms_error
  • views_used
  • found
pattern_cols4
pattern_rows11
grid_layoutasymmetric (staggered)
square_size1.00
Categoryimage/CV/features

Inputs (5)

NameTypeDefaultDescription
imagesIMAGEBatch of circle-grid views from different angles (>= 3 usable; ~10-20 gives a good fit).
pattern_colsINT42–40Circle centers per row (width of the grid).
pattern_rowsINT112–40Circle centers per column (height of the grid).
grid_layoutCOMBOasymmetric (staggered)Grid geometry. Asymmetric staggers each row by half a spacing, which removes the 180-degree rotational ambiguity of symmetric targets - the reason stereo and wide-angle calibration prefer it.
square_sizeoptFLOAT1.000.0001–1000000Physical center-to-center spacing (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_coeffsNPARRAYDistortion coefficients (k1, k2, p1, p2, k3).
rms_errorFLOATMean reprojection error in pixels; lower is better (<1 good).
views_usedINTNumber of input views with a detectable grid.
foundBOOLEAN