CV Omnidir Calibrate (Chessboard)
Calibrates a catadioptric / >180-degree lens with CMei's omnidirectional model (cv2.omnidir.calibrate). It adds a mirror parameter 'xi' to the usual K and four (k1, k2, p1, p2) coefficients, which is what lets it describe a view wider than any pinhole or fisheye model. Feed a batch of chessboard views; corner detection uses a 7x7 refinement window by default because the usual 11x11 drags corners several pixels on a compressed omnidir view. WATCH THE PARAMETERS, not just the RMS: focal length and xi are strongly correlated, so a fit can reproject at 0.05 px while reporting fx 327 / xi 0.96 for a camera whose truth is 300 / 0.80 - unless the boards cover the periphery, where the two stop being interchangeable. Failure tolerant: fewer than 3 usable views, or a cv2 error, returns found=false.
- images
- camera_matrix
- xi
- dist_coeffs
- rms_error
- views_used
- found
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Batch of chessboard views from different angles (>= 3 usable). Spread them across the frame: the xi/focal degeneracy is what wide coverage breaks. | |
| 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_FIX_SKEW | Solver options, OR-ed. These are the cv2.omnidir constants, NOT the top-level CALIB_* ones of the same name (different values). FIX_SKEW pins alpha to 0; FIX_XI holds the mirror parameter; FIX_CENTER holds the principal point. |
| square_sizeopt | FLOAT | 1.000.0001–1000000 | Physical size of one square; sets the world scale. |
| refine_windowopt | INT | 73–31 | cornerSubPix search window (full width, odd). 7 by default because at 11 the window spans neighbouring squares where the image is compressed and pulls corners up to 7 px away from where the model says they are - and the calibration RMS goes DOWN when that happens (0.057 against 0.073 px on the shipped boards), because a smooth bias is absorbed by the parameters. Do not tune this by RMS. |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| camera_matrix | NPARRAY | 3x3 intrinsic matrix K. |
| xi | FLOAT | CMei's mirror parameter. 0 would be a pinhole; the bigger it is, the further past 180 degrees the model reaches. |
| dist_coeffs | NPARRAY | FOUR coefficients (k1, k2, p1, p2) as 4x1 - the omnidir set, not the pinhole or fisheye one. |
| rms_error | FLOAT | Mean reprojection error in pixels. A small value does NOT mean K and xi are individually right. |
| views_used | INT | Views cv2 actually kept (it drops some itself). |
| found | BOOLEAN | — |