@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/src/model.ts CHANGED
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Every detector in the vitavision family (calib-targets' chessboard, ChArUco, marker board and
5
5
  * PuzzleBoard, ringgrid, chess-corners) returns its own result shape. An app maps that shape to a
6
- * `TargetDetection` once, and the overlay never learns which library ran. Nothing here imports a
7
- * detector package: these are plain data types.
6
+ * `TargetDetection` once (for calib-targets, `fromCalibTargets` is that mapping), and the overlay
7
+ * never learns which library ran. Nothing here imports a detector package: these are plain data
8
+ * types.
8
9
  *
9
10
  * Conventions, the same as `@vitavision/stage2d`:
10
11
  * - Positions are **image pixels, with the centre of pixel `i` at coordinate `i`** (the frame
@@ -19,14 +20,7 @@
19
20
  export type TargetId = string | number;
20
21
 
21
22
  /** What a detection is of. It chooses defaults, not what is drawn: whatever is present is drawn. */
22
- export type TargetKind =
23
- | "chessboard"
24
- | "charuco"
25
- | "markerboard"
26
- | "puzzleboard"
27
- | "ringgrid"
28
- | "corners"
29
- | "circles";
23
+ export type TargetKind = "chessboard" | "charuco" | "markerboard" | "puzzleboard" | "ringgrid" | "corners" | "circles";
30
24
 
31
25
  /** Every `TargetKind`. */
32
26
  export const TARGET_KINDS: readonly TargetKind[] = [
@@ -66,13 +60,19 @@ export interface TargetCorner {
66
60
  j?: number | undefined;
67
61
  /**
68
62
  * The detector's confidence. It is carried for the app (a list, a filter) and never drawn as a
69
- * colour: a score is not a verdict (visual-language §5).
63
+ * colour: a score is not a verdict.
70
64
  */
71
65
  score?: number | undefined;
72
66
  /** Orientation of the first edge through the corner, radians. Axes are lines, so `angle` and `angle + π` are the same. */
73
67
  angle?: number | undefined;
74
68
  /** Orientation of the second edge through the corner, radians. Needs `angle`. */
75
69
  angle2?: number | undefined;
70
+ /**
71
+ * The covariance of the position, image pixels squared: the three distinct entries
72
+ * `[xx, xy, yy]` of the symmetric 2×2 matrix. `TargetOverlay`'s `uncertainty` prop draws it as
73
+ * a 1σ ellipse; a matrix that is not positive definite is not drawn.
74
+ */
75
+ cov?: readonly [xx: number, xy: number, yy: number] | undefined;
76
76
  /** Text beside it. Defaults to the lattice index `i,j` on a board, else the id. */
77
77
  label?: string | undefined;
78
78
  }