@vitavision/overlays 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @vitavision/overlays
2
2
 
3
- Calibration-target overlays for the vitavision lab apps, on the `@vitavision/stage2d` image stage: one `TargetOverlay` for a chessboard, ChArUco board, marker board, PuzzleBoard, ring grid or a loose set of corners.
3
+ Calibration-target overlays for the vitavision apps, on the `@vitavision/stage2d` image stage: one `TargetOverlay` for a chessboard, ChArUco board, marker board, PuzzleBoard, ring grid or a loose set of corners.
4
4
 
5
5
  ```bash
6
6
  bun add @vitavision/overlays @vitavision/stage2d @vitavision/ui
@@ -35,7 +35,7 @@ A `TargetDetection` is one detection run, independent of the library that produc
35
35
  | Field | Items |
36
36
  |---|---|
37
37
  | `kind` | `"chessboard" \| "charuco" \| "markerboard" \| "puzzleboard" \| "ringgrid" \| "corners" \| "circles"`. The four boards draw lattice edges; the others do not. |
38
- | `corners` | `{ id, x, y, i?, j?, score?, angle?, angle2?, label? }` |
38
+ | `corners` | `{ id, x, y, i?, j?, score?, angle?, angle2?, cov?, label? }` |
39
39
  | `markers` | `{ id, corners: [x0, y0, … x3, y3], label? }` |
40
40
  | `circles` | `{ id, x, y, polarity: "white" \| "black", i?, j?, label? }` |
41
41
  | `rings` | `{ id, x, y, outer: { rx, ry, angle }, inner?, label? }` |
@@ -43,11 +43,45 @@ A `TargetDetection` is one detection run, independent of the library that produc
43
43
 
44
44
  Positions are image pixels with the **centre of pixel `i` at coordinate `i`**, which is what the WASM detectors report and what stage2d expects: do not add 0.5. Angles are radians, clockwise on screen. `rx`, `ry` and `radius` are image pixels, so they scale with the image. Ids must be unique within a detection; `selectedIds` and `hoveredId` apply to every part that has the id.
45
45
 
46
+ `cov` is the position covariance `[xx, xy, yy]` in image pixels squared, drawn on request as an uncertainty ellipse (below).
47
+
46
48
  `edgeBitsFromPuzzleboard(edges, corners, alignment)` builds `edgeBits` from a PuzzleBoard decode: it maps each observed edge through the alignment (modulo the 501 master period) to its two corners and places the dot at the midpoint, with a radius of a quarter of the edge.
47
49
 
50
+ ## From calib-targets
51
+
52
+ `fromCalibTargets` maps a result of the `@vitavision/calib-targets` detectors to a `TargetDetection`. Tag the result with the detector that produced it; TypeScript then checks the rest against that detector's shape:
53
+
54
+ ```ts
55
+ import { fromCalibTargets } from "@vitavision/overlays";
56
+
57
+ fromCalibTargets({ kind: "chessboard", detection: detect_chessboard(w, h, gray, chess, params) });
58
+ fromCalibTargets({ kind: "charuco", detection: detect_charuco(w, h, gray, null, params) });
59
+ fromCalibTargets({ kind: "corners", corners: detect_corners(w, h, gray, chess) });
60
+
61
+ // The marker-board circles and the PuzzleBoard edge bits come from a diagnose_* call:
62
+ // `diagnosis` is diagnose_puzzleboard's payload, as plain objects.
63
+ const { result, diagnostics } = diagnosis;
64
+ fromCalibTargets({ kind: "puzzleboard", detection: result, diagnostics });
65
+ ```
66
+
67
+ | `kind` | Corners | Also |
68
+ |---|---|---|
69
+ | `chessboard` | lattice, labelled `i,j` from the grid's `(u, v)` | |
70
+ | `charuco` | lattice | `markers` from each marker's `corners_img`, labelled with its dictionary id |
71
+ | `markerboard` | lattice | `circles` from `diagnostics`: the matched board circles, at the candidate's centre |
72
+ | `puzzleboard` | lattice in master indices | `edgeBits` from `diagnostics.observed_edges`, through the alignment |
73
+ | `puzzlepole` | drawn as a `puzzleboard` lattice | |
74
+ | `corners` | both axes as edge directions; `strength` is the score | |
75
+
76
+ - **Positions** pass through unchanged: calib-targets reports the centre of pixel `i` at `i`, as the overlay expects.
77
+ - **Ids** are `corner-<n>`, `marker-<n>` and `circle-<n>`, `n` being the index into the result's `corners`, `markers` or `circle_matches`, so a hover or press maps straight back to the item.
78
+ - **A miss** (`detection: null`, or `undefined` from a `diagnose_*` call) gives an empty detection of the same kind.
79
+ - **Covariance**: a corner's `position_covariance`, when the result has one, becomes its `cov`. Results without the field are accepted as they are.
80
+ - **No dependency**: the input types are the minimal structure the mapping reads, so the package does not depend on `@vitavision/calib-targets`; its result types fit them as they are. A `diagnose_*` payload must be plain objects: convert it first if it arrives as `Map`s.
81
+
48
82
  ## What is drawn
49
83
 
50
- Each part goes to the stage2d layer that fits it, batched by appearance (ADR-0004), so a detection of thousands of items is a few dozen DOM nodes and the pointer is resolved by the stage's hit-test index.
84
+ Each part goes to the stage2d layer that fits it, batched by appearance, so a detection of thousands of items is a few dozen DOM nodes and the pointer is resolved by the stage's hit-test index.
51
85
 
52
86
  | Part | Drawn as | Layer |
53
87
  |---|---|---|
@@ -56,11 +90,14 @@ Each part goes to the stage2d layer that fits it, batched by appearance (ADR-000
56
90
  | `circles` | white: a hollow ring; black: a ring with a centre dot | `PointSet` |
57
91
  | `rings` | the fitted outer and inner ellipse (exact arcs, image-sized) and a plus at the centre | `EllipseSet` + `PointSet` |
58
92
  | `edgeBits` | a dot on the edge: solid for 1, dashed for 0, opacity 35 to 100 % from confidence | `EllipseSet` |
93
+ | corners' `cov` | with `uncertainty={{ scale }}`: the 1σ ellipse, both semi-axes × `scale`, under the corners | `EllipseSet` |
59
94
 
60
95
  Colours are overlay roles only (`feature`, `model`, `structure`, `selection`). A score is never drawn as a verdict colour; polarity and bits are shapes, not hues.
61
96
 
62
97
  States follow the overlay grammar: hover 2 px, selected 2.5 px in the selection colour with a ring on points, dimmed at 35 % opacity (`dimmed` takes `true`, a list of ids, or a predicate). Labels appear only where items are 24 screen px apart, at most 200 at a time.
63
98
 
99
+ **Uncertainty ellipses** are opt-in: `uncertainty={{ scale: 40 }}`. A detector's σ is a small fraction of a pixel, so the ellipse is drawn magnified; its shape and orientation are the data's, and its size is σ × `scale`. Print the scale beside the image ("ellipses ×40"), as you would a residual's gain; the layer's accessible name carries it too. The ellipses are in the `model` role, follow their corner's hover, selection and dimming, and are not picked. A covariance that is not positive definite is not drawn.
100
+
64
101
  `onHoverChange` and `onItemPress` report `{ id, part }` with the id from the detection (`part` is `"corner"`, `"marker"`, `"circle"` or `"ring"`). A hover that moves between layers is reported once.
65
102
 
66
103
  ## Pieces
@@ -70,7 +107,7 @@ For an app that composes the layers itself:
70
107
  - **Lattice**: `cornerGrid`, `gridEdges`, `idByGrid`, `gridKey`, `markerPolygons` (pure; `gridEdges` is stage2d's `latticeEdges` with positions).
71
108
  - **Glyphs**: `TARGET_MARKERS` (`directed`, `circle-white`, `circle-black`) for `PointSet`'s `markers`; the `directed` marker reads a corner's two edge directions from `PointSetItem.angle` and `angle2`.
72
109
  - **Layers**: `EllipseSet` and `ellipsePath`, re-exported from `@vitavision/stage2d`: a batched set of ellipses whose size is data. `TargetOverlay` draws its rings with `pickable={false}`.
73
- - **Mapping**: `cornerNodes`, `markerAreas`, `circlePoints`, `ringCentres`, `ringEllipses`, `edgeBitEllipses` are the detection-to-layer-items functions `TargetOverlay` uses.
110
+ - **Mapping**: `cornerNodes`, `markerAreas`, `circlePoints`, `ringCentres`, `ringEllipses`, `edgeBitEllipses`, `uncertaintyEllipses` are the detection-to-layer-items functions `TargetOverlay` uses. `covarianceEllipse(cov, scale)` is the eigen-decomposition behind the last: the ellipse of a 2×2 covariance, or `null` when it is not positive definite.
74
111
 
75
112
  ## License
76
113
 
package/dist/index.d.ts CHANGED
@@ -5,8 +5,9 @@ import { AreaSetItem, EllipseSet, EllipseSetItem, EllipseSetItem as EllipseSetIt
5
5
  *
6
6
  * Every detector in the vitavision family (calib-targets' chessboard, ChArUco, marker board and
7
7
  * PuzzleBoard, ringgrid, chess-corners) returns its own result shape. An app maps that shape to a
8
- * `TargetDetection` once, and the overlay never learns which library ran. Nothing here imports a
9
- * detector package: these are plain data types.
8
+ * `TargetDetection` once (for calib-targets, `fromCalibTargets` is that mapping), and the overlay
9
+ * never learns which library ran. Nothing here imports a detector package: these are plain data
10
+ * types.
10
11
  *
11
12
  * Conventions, the same as `@vitavision/stage2d`:
12
13
  * - Positions are **image pixels, with the centre of pixel `i` at coordinate `i`** (the frame
@@ -43,13 +44,19 @@ interface TargetCorner {
43
44
  j?: number | undefined;
44
45
  /**
45
46
  * The detector's confidence. It is carried for the app (a list, a filter) and never drawn as a
46
- * colour: a score is not a verdict (visual-language §5).
47
+ * colour: a score is not a verdict.
47
48
  */
48
49
  score?: number | undefined;
49
50
  /** Orientation of the first edge through the corner, radians. Axes are lines, so `angle` and `angle + π` are the same. */
50
51
  angle?: number | undefined;
51
52
  /** Orientation of the second edge through the corner, radians. Needs `angle`. */
52
53
  angle2?: number | undefined;
54
+ /**
55
+ * The covariance of the position, image pixels squared: the three distinct entries
56
+ * `[xx, xy, yy]` of the symmetric 2×2 matrix. `TargetOverlay`'s `uncertainty` prop draws it as
57
+ * a 1σ ellipse; a matrix that is not positive definite is not drawn.
58
+ */
59
+ cov?: readonly [xx: number, xy: number, yy: number] | undefined;
53
60
  /** Text beside it. Defaults to the lattice index `i,j` on a board, else the id. */
54
61
  label?: string | undefined;
55
62
  }
@@ -183,6 +190,19 @@ interface TargetOverlayProps {
183
190
  * opacity. They still take hover and presses. Pass a stable value: a new one re-batches.
184
191
  */
185
192
  dimmed?: boolean | Iterable<TargetId> | ((id: TargetId) => boolean) | undefined;
193
+ /**
194
+ * Draw each corner's position covariance (`cov`) as its 1σ ellipse with both semi-axes
195
+ * multiplied by `scale`, in the `model` role, under the corners. Off by default.
196
+ *
197
+ * A detector's σ is a small fraction of a pixel, so the ellipses are drawn magnified: the
198
+ * `scale` is the app's to choose and to print beside the image ("ellipses ×40"), as a
199
+ * residual's gain is. Their shape and orientation are the data's. A corner with no covariance,
200
+ * or one that is not positive definite, gets none. The ellipses take the corner's hover,
201
+ * selection and dimming, and are not picked themselves.
202
+ */
203
+ uncertainty?: {
204
+ scale: number;
205
+ } | undefined;
186
206
  /** Prefix of the hit-test layer ids (`<prefix>-corners`, `-markers`, `-circles`, `-rings`). Defaults to generated ids. */
187
207
  layerIdPrefix?: string | undefined;
188
208
  }
@@ -198,10 +218,12 @@ interface TargetOverlayProps {
198
218
  * - **Callbacks** report `{ id, part }` with the id from the detection. A press and a hover move
199
219
  * between layers (a corner, then the marker under it) without a flicker: the change is reported
200
220
  * once.
221
+ * - **Uncertainty** (opt-in, `uncertainty`): each corner's covariance as a 1σ ellipse × the
222
+ * given scale, under the corners.
201
223
  *
202
224
  * The layers it renders carry their own accessible names ("Corners: 54 points, 0 selected").
203
225
  */
204
- export declare function TargetOverlay({ detection, showEdges, showLabels, hoveredId, selectedIds, onHoverChange, onItemPress, dimmed, layerIdPrefix }: TargetOverlayProps): import("react").JSX.Element;
226
+ export declare function TargetOverlay({ detection, showEdges, showLabels, hoveredId, selectedIds, onHoverChange, onItemPress, dimmed, uncertainty, layerIdPrefix }: TargetOverlayProps): import("react").JSX.Element;
205
227
  //#endregion
206
228
  //#region src/lattice.d.ts
207
229
  /** A corner that has a place on the board. */
@@ -416,6 +438,233 @@ export declare function ringEllipses(rings: readonly TargetRing[]): {
416
438
  * @returns One ellipse (a circle) per bit.
417
439
  */
418
440
  export declare function edgeBitEllipses(bits: readonly TargetEdgeBit[]): EllipseSetItem$1[];
441
+ /**
442
+ * The ellipse of a 2×2 position covariance: `scale` standard deviations along each principal
443
+ * axis.
444
+ *
445
+ * The semi-axes are `scale · √λ` for the matrix's two eigenvalues `λ₁ ≥ λ₂`, and `angle` is the
446
+ * direction of the eigenvector of `λ₁` (radians, clockwise on screen, in `(-π/2, π/2]`). At
447
+ * `scale = 1` this is the 1σ ellipse: the curve `dᵀ Σ⁻¹ d = 1`.
448
+ *
449
+ * @param cov - The covariance `[xx, xy, yy]`, image pixels squared.
450
+ * @param scale - The gain applied to both semi-axes. Defaults to 1.
451
+ * @returns The ellipse, or `null` when the matrix is not finite and positive definite, or the
452
+ * scale is not a finite positive number: there is no ellipse to draw.
453
+ */
454
+ export declare function covarianceEllipse(cov: readonly [xx: number, xy: number, yy: number], scale?: number): TargetEllipse | null;
455
+ /**
456
+ * The ellipses of the uncertainty layer: each corner's position covariance as a 1σ ellipse,
457
+ * both semi-axes multiplied by `scale`, centred on the corner and sharing its id, in the `model`
458
+ * role. A corner with no covariance, or one that is not positive definite, has none.
459
+ *
460
+ * @param corners - The corners.
461
+ * @param scale - The gain on the semi-axes. A detector's σ is a fraction of a pixel, so it is
462
+ * drawn magnified; print the gain beside the image ("ellipses ×40").
463
+ * @returns One ellipse per corner with a drawable covariance, in order.
464
+ */
465
+ export declare function uncertaintyEllipses(corners: readonly TargetCorner[], scale: number): EllipseSetItem$1[];
466
+ //#endregion
467
+ //#region src/calibTargets.d.ts
468
+ /** An image point `[x, y]`, pixels with the centre of pixel `i` at `i` (calib-targets' `Point2`). */
469
+ type CalibTargetsPoint = readonly [x: number, y: number];
470
+ /** A position covariance, image pixels squared (calib-targets' `position_covariance`). */
471
+ interface CalibTargetsCovariance {
472
+ /** Variance along x. */
473
+ xx: number;
474
+ /** Covariance of x and y. */
475
+ xy: number;
476
+ /** Variance along y. */
477
+ yy: number;
478
+ }
479
+ /** An integer lattice coordinate (calib-targets' `Coord`): `u` along the first board axis, `v` the second. */
480
+ interface CalibTargetsCoord {
481
+ /** First axis, rightwards on the board. */
482
+ u: number;
483
+ /** Second axis, downwards on the board. */
484
+ v: number;
485
+ }
486
+ /** A labelled board corner: what `ChessboardCorner`, `CharucoCorner`, `MarkerBoardCorner` and `PuzzleBoardCorner` share. */
487
+ interface CalibTargetsLabeledCorner {
488
+ /** Sub-pixel image position. */
489
+ position: CalibTargetsPoint;
490
+ /** Lattice label; `null` for a corner with no place on the board. */
491
+ grid: CalibTargetsCoord | null;
492
+ /** The detector's score, higher is better. */
493
+ score: number;
494
+ /** Position covariance, when the detector reports one. */
495
+ position_covariance?: CalibTargetsCovariance | null | undefined;
496
+ }
497
+ /** One axis estimate of a raw corner (calib-targets' `AxisEstimate`). */
498
+ interface CalibTargetsAxis {
499
+ /** Direction of the axis, radians in the image frame (clockwise on screen). */
500
+ angle: number;
501
+ }
502
+ /** A raw ChESS corner, as `detect_corners` returns it (calib-targets' `Corner`). */
503
+ interface CalibTargetsCorner {
504
+ /** Sub-pixel image position. */
505
+ position: CalibTargetsPoint;
506
+ /** The two grid axes through the corner. */
507
+ axes: readonly [CalibTargetsAxis, CalibTargetsAxis];
508
+ /** Corner response, higher is stronger. */
509
+ strength: number;
510
+ /** Position covariance, when the detector reports one. */
511
+ position_covariance?: CalibTargetsCovariance | null | undefined;
512
+ }
513
+ /** A chessboard detection (`ChessboardDetection`). */
514
+ interface CalibTargetsChessboardDetection {
515
+ /** The labelled corners. */
516
+ corners: readonly CalibTargetsLabeledCorner[];
517
+ }
518
+ /** A decoded ArUco marker of a ChArUco detection (`MarkerDetection`). */
519
+ interface CalibTargetsMarker {
520
+ /** The marker's dictionary id. */
521
+ id: number;
522
+ /** Its four corners in the image, in the marker's own order; `null` when they were not projected. */
523
+ corners_img: readonly [CalibTargetsPoint, CalibTargetsPoint, CalibTargetsPoint, CalibTargetsPoint] | null;
524
+ }
525
+ /** A ChArUco detection (`CharucoDetection`). */
526
+ interface CalibTargetsCharucoDetection {
527
+ /** The labelled corners. */
528
+ corners: readonly CalibTargetsLabeledCorner[];
529
+ /** The markers consistent with the board alignment. */
530
+ markers: readonly CalibTargetsMarker[];
531
+ }
532
+ /** A checkerboard marker board detection (`MarkerBoardDetection`). */
533
+ interface CalibTargetsMarkerBoardDetection {
534
+ /** The labelled corners. */
535
+ corners: readonly CalibTargetsLabeledCorner[];
536
+ }
537
+ /** A scored circle hypothesis of a marker board (`CircleCandidate`). */
538
+ interface CalibTargetsCircleCandidate {
539
+ /** Centre of the circle in the image. */
540
+ center_img: CalibTargetsPoint;
541
+ }
542
+ /** A board circle paired with a detected one (`CircleMatch`). */
543
+ interface CalibTargetsCircleMatch {
544
+ /** The circle the board layout expects: its cell and printed polarity. */
545
+ expected: {
546
+ cell: {
547
+ i: number;
548
+ j: number;
549
+ };
550
+ polarity: "white" | "black";
551
+ };
552
+ /** Index into `circle_candidates` of the circle that matched it, or `null` for none. */
553
+ matched_index: number | null;
554
+ }
555
+ /** The part of `diagnose_marker_board`'s `diagnostics` the overlay draws (`MarkerBoardDiagnostics`). */
556
+ interface CalibTargetsMarkerBoardDiagnostics {
557
+ /** The circle hypotheses. */
558
+ circle_candidates: readonly CalibTargetsCircleCandidate[];
559
+ /** The board's circles and the candidates they matched. */
560
+ circle_matches: readonly CalibTargetsCircleMatch[];
561
+ }
562
+ /** A grid alignment (`GridAlignment`): `master = matrix · local + translation`. */
563
+ interface CalibTargetsAlignment {
564
+ /** Row-major integer matrix, applied to local `(u, v)` before the translation. */
565
+ matrix: readonly [readonly [number, number], readonly [number, number]];
566
+ /** Integer translation, grid units. */
567
+ translation: readonly [number, number];
568
+ }
569
+ /** A PuzzleBoard detection (`PuzzleBoardDetection`); its corners carry master labels. */
570
+ interface CalibTargetsPuzzleBoardDetection {
571
+ /** The labelled corners, `grid` in the master frame. */
572
+ corners: readonly CalibTargetsLabeledCorner[];
573
+ /** The map from the decoder's local frame to the master frame. */
574
+ alignment: CalibTargetsAlignment;
575
+ }
576
+ /** One observed edge bit, in the decoder's local frame (`PuzzleBoardObservedEdge`). */
577
+ interface CalibTargetsObservedEdge {
578
+ /** Row of the edge's first corner. */
579
+ row: number;
580
+ /** Column of the edge's first corner. */
581
+ col: number;
582
+ /** Which neighbour the edge runs to. */
583
+ orientation: "horizontal" | "vertical";
584
+ /** The observed bit, 0 or 1. */
585
+ bit: number;
586
+ /** Per-bit confidence, [0, 1]. */
587
+ confidence: number;
588
+ }
589
+ /** The part of `diagnose_puzzleboard`'s `diagnostics` the overlay draws (`PuzzleBoardDiagnostics`). */
590
+ interface CalibTargetsPuzzleBoardDiagnostics {
591
+ /** Every sampled edge, before alignment. */
592
+ observed_edges: readonly CalibTargetsObservedEdge[];
593
+ }
594
+ /** A PuzzlePole detection: a PuzzleBoard wrapped round a cylinder; `grid` is (axial, around). */
595
+ interface CalibTargetsPuzzlePoleDetection {
596
+ /** The labelled corners. */
597
+ corners: readonly CalibTargetsLabeledCorner[];
598
+ }
599
+ /**
600
+ * One calib-targets result, tagged with the detector that produced it.
601
+ *
602
+ * A board detector returns `null` (or, from `diagnose_*`, `undefined`) when it finds nothing;
603
+ * pass that through as `detection` and the result is an empty detection of the same kind.
604
+ * `diagnostics` is the `diagnostics` of the matching `diagnose_*` call: it carries what the plain
605
+ * result does not (the marker-board circles, the PuzzleBoard edge bits). Convert a `diagnose_*`
606
+ * payload to plain objects first if your binding returns `Map`s.
607
+ */
608
+ type CalibTargetsResult = {
609
+ /** Raw ChESS corners, from `detect_corners`. */
610
+ kind: "corners";
611
+ /** The corners. */
612
+ corners: readonly CalibTargetsCorner[];
613
+ } | {
614
+ /** A chessboard, from `detect_chessboard`. */
615
+ kind: "chessboard";
616
+ /** The detection, or `null` when none was found. */
617
+ detection: CalibTargetsChessboardDetection | null | undefined;
618
+ } | {
619
+ /** A ChArUco board, from `detect_charuco` or `diagnose_charuco`. */
620
+ kind: "charuco";
621
+ /** The detection, or `null` when none was found. */
622
+ detection: CalibTargetsCharucoDetection | null | undefined;
623
+ } | {
624
+ /** A checkerboard marker board, from `detect_marker_board` or `diagnose_marker_board`. */
625
+ kind: "markerboard";
626
+ /** The detection, or `null` when none was found. */
627
+ detection: CalibTargetsMarkerBoardDetection | null | undefined;
628
+ /** `diagnose_marker_board`'s diagnostics, for the matched circles. */
629
+ diagnostics?: CalibTargetsMarkerBoardDiagnostics | null | undefined;
630
+ } | {
631
+ /** A PuzzleBoard, from `detect_puzzleboard` or `diagnose_puzzleboard`. */
632
+ kind: "puzzleboard";
633
+ /** The detection, or `null` when none was found. */
634
+ detection: CalibTargetsPuzzleBoardDetection | null | undefined;
635
+ /** `diagnose_puzzleboard`'s diagnostics, for the edge bits. */
636
+ diagnostics?: CalibTargetsPuzzleBoardDiagnostics | null | undefined;
637
+ } | {
638
+ /** A PuzzlePole. Drawn as a PuzzleBoard lattice, without edge bits. */
639
+ kind: "puzzlepole";
640
+ /** The detection, or `null` when none was found. */
641
+ detection: CalibTargetsPuzzlePoleDetection | null | undefined;
642
+ };
643
+ /**
644
+ * The `TargetDetection` of a calib-targets result.
645
+ *
646
+ * - **Kinds.** `chessboard`, `charuco`, `markerboard`, `puzzleboard` and raw `corners` map to the
647
+ * overlay kind of the same name; a `puzzlepole` is drawn as a `puzzleboard` lattice.
648
+ * - **Corners.** Positions pass through unchanged (calib-targets reports the centre of pixel `i`
649
+ * at `i`, as the overlay expects). A labelled corner's grid `(u, v)` becomes `(i, j)`, so a
650
+ * board draws its lattice and labels corners `i,j`. A raw corner draws its two axes (`angle`,
651
+ * `angle2`) and is labelled with its index; its `strength` is the `score`.
652
+ * - **Covariance.** A corner's `position_covariance`, when present and finite, becomes `cov`;
653
+ * `TargetOverlay` draws it with `uncertainty`.
654
+ * - **Markers** (ChArUco) are the quads of `corners_img`, labelled with the dictionary id; a
655
+ * marker without a projected quad is left out.
656
+ * - **Circles** (marker board, from `diagnostics`) are the board circles a candidate matched,
657
+ * at the candidate's centre with the board's cell and polarity.
658
+ * - **Edge bits** (PuzzleBoard, from `diagnostics`) are the observed edges placed through the
659
+ * alignment with `edgeBitsFromPuzzleboard`.
660
+ *
661
+ * Ids are `corner-<n>`, `marker-<n>` and `circle-<n>`, where `n` is the index into the result's
662
+ * `corners`, `markers` or `circle_matches`, so a hover or a press maps straight back to it.
663
+ *
664
+ * @param result - The result, tagged with its kind.
665
+ * @returns The detection for `TargetOverlay`. Parts with no items are left out.
666
+ */
667
+ export declare function fromCalibTargets(result: CalibTargetsResult): TargetDetection;
419
668
  //#endregion
420
- export { type CirclePolarity, type CornerGrid, EllipseSet, type EllipseSetItem, type EllipseSetProps, type GridBounds, type GridCorner, type GridSegment, type MarkerPolygon, type PuzzleboardAlignment, type PuzzleboardEdge, type TargetCircle, type TargetCorner, type TargetDetection, type TargetEdgeBit, type TargetEllipse, type TargetHit, type TargetId, type TargetKind, type TargetMarker, type TargetOverlayProps, type TargetPart, type TargetRing, ellipsePath };
669
+ export { type CalibTargetsAlignment, type CalibTargetsAxis, type CalibTargetsCharucoDetection, type CalibTargetsChessboardDetection, type CalibTargetsCircleCandidate, type CalibTargetsCircleMatch, type CalibTargetsCoord, type CalibTargetsCorner, type CalibTargetsCovariance, type CalibTargetsLabeledCorner, type CalibTargetsMarker, type CalibTargetsMarkerBoardDetection, type CalibTargetsMarkerBoardDiagnostics, type CalibTargetsObservedEdge, type CalibTargetsPoint, type CalibTargetsPuzzleBoardDetection, type CalibTargetsPuzzleBoardDiagnostics, type CalibTargetsPuzzlePoleDetection, type CalibTargetsResult, type CirclePolarity, type CornerGrid, EllipseSet, type EllipseSetItem, type EllipseSetProps, type GridBounds, type GridCorner, type GridSegment, type MarkerPolygon, type PuzzleboardAlignment, type PuzzleboardEdge, type TargetCircle, type TargetCorner, type TargetDetection, type TargetEdgeBit, type TargetEllipse, type TargetHit, type TargetId, type TargetKind, type TargetMarker, type TargetOverlayProps, type TargetPart, type TargetRing, ellipsePath };
421
670
  //# sourceMappingURL=index.d.ts.map