calib-targets-marker
calib-targets-marker targets a checkerboard marker board: a chessboard grid with three circular markers near the center. The detector is grid-first and works with partial boards.
Detected circle markers and aligned grid overlay.
For the end-to-end stage map, failure modes, and tuning, see the Marker board pipeline. This page is the crate API reference.
Detection pipeline
- Chessboard detection: run
calib-targets-chessboardto obtain grid-labeled corners (partial boards are allowed). - Per-cell circle scoring: for every valid square cell, warp the cell to a canonical patch and score a circle by comparing a disk sample to an annular ring.
- Candidate filtering: keep the strongest circle candidates per polarity.
- Circle matching: match candidates to the expected layout (cell coordinates + polarity).
- Grid alignment estimation: derive a dihedral transform + translation from detected grid coordinates to board coordinates when enough circles agree.
Key types
MarkerBoardDetector: main entry point.MarkerBoardSpec: rows/cols plus the three expected circles (cell coordinate + polarity).MarkerBoardParams: board layout + chessboard params + circle score + match settings.MarkerBoardDetection:detection:TargetDetectionlabeled asCheckerboardMarker.alignment: optionalGridAlignmentsemantic alias for the canonical affineGridTransform, from detected grid coordinates to board coordinates.
MarkerBoardDiagnostics(opt-in, from thediagnose/diagnose_with_cornersentry points):circle_candidates: scored circles per cell.circle_matches: matched circles (with offsets).inliers: per-corner provenance back into the input ChESS-corner slice.alignment_inliers: circles consistent with the best board frame.alignment_runner_up_inliers: circles consistent with the best competing frame.alignment_ambiguous: a second frame explained the circles just as well, so no alignment was returned.
Parameters
MarkerBoardSpec defines the board and marker placement:
rows,cols: inner corner counts.cell_size: optional square size in your world units (when set,target_positionis populated).circles: threeMarkerCircleSpecentries withcell(top-left corner indices) andpolarity.circle_diameter_rel: printed disc diameter as a fraction of the square side (default0.5). Every radius the circle scorer probes is relative to this, so it is the one place the disc size is stated — it matchescircle_diameter_relon the printable spec.
MarkerBoardParams configures detection:
board: theMarkerBoardSpecto detect.chessboard:ChessboardParamsfor the underlying corner-grid step. The chessboard detector is scale-invariant, so the v1expected_rows/colsandcompleteness_thresholdknobs no longer apply — the marker circles supply the geometry constraint.circle_score: per-cell circle scoring parameters.match_params: candidate filtering and matching thresholds.roi_cells: optional cell ROI[i0, j0, i1, j1].
CircleScoreParams controls scoring:
patch_size: canonical square size in pixels.ring_thickness_frac: ring thickness relative to circle radius.ring_radius_mul: ring radius relative to circle radius.min_contrast: minimum accepted disk-vs-ring contrast.samples: samples per ring for averaging.center_search_px: small pixel search around the cell center.
CircleMatchParams controls matching:
max_candidates_per_polarity: top-N candidates to keep per polarity.min_offset_inliers: circles that must agree on one board frame before it is returned. Defaults to3— the whole layout.
Notes
- Cell coordinates
(i, j)refer to square cells, expressed by the top-left corner indices. The cell center is at(i + 0.5, j + 0.5). alignmentmaps detected grid coordinates into board coordinates using a rotation and a translation, and it is the frame the returned corner labels are already expressed in.- A circle’s polarity is fixed by the square underneath it:
whiteon an eveni + j,blackon an odd one. Any other combination draws a disc the same colour as its square, andcalib-targets-printrejects it. - The frame search covers only the four rotations, not the eight dihedral transforms. A camera imaging the printed side of an opaque board cannot produce a reflection, so including them would only let physically unreachable hypotheses compete with the true one.
- Resolving the frame is all-or-nothing by design. A single circle is consistent with all four rotations, and two leave no redundancy, so anything short of the full layout agreeing — or a second frame agreeing equally well — comes back as a typed error rather than a guess.