@vitavision/overlays 0.2.1 → 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 +39 -2
- package/dist/index.d.ts +253 -4
- package/dist/index.js +228 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/TargetOverlay.tsx +59 -24
- package/src/calibTargets.ts +361 -0
- package/src/index.ts +28 -7
- package/src/lattice.ts +1 -3
- package/src/layerItems.ts +59 -1
- package/src/model.ts +10 -10
package/README.md
CHANGED
|
@@ -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,8 +43,42 @@ 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
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.
|
|
@@ -56,11 +90,14 @@ Each part goes to the stage2d layer that fits it, batched by appearance, so a de
|
|
|
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
|
|
9
|
-
* detector package: these are plain data
|
|
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
|
|
@@ -50,6 +51,12 @@ interface TargetCorner {
|
|
|
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
|
package/dist/index.js
CHANGED
|
@@ -393,6 +393,59 @@ function edgeBitEllipses(bits) {
|
|
|
393
393
|
opacity: BIT_OPACITY_MIN + .65 * Math.min(1, Math.max(0, bit.confidence))
|
|
394
394
|
}));
|
|
395
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* The ellipse of a 2×2 position covariance: `scale` standard deviations along each principal
|
|
398
|
+
* axis.
|
|
399
|
+
*
|
|
400
|
+
* The semi-axes are `scale · √λ` for the matrix's two eigenvalues `λ₁ ≥ λ₂`, and `angle` is the
|
|
401
|
+
* direction of the eigenvector of `λ₁` (radians, clockwise on screen, in `(-π/2, π/2]`). At
|
|
402
|
+
* `scale = 1` this is the 1σ ellipse: the curve `dᵀ Σ⁻¹ d = 1`.
|
|
403
|
+
*
|
|
404
|
+
* @param cov - The covariance `[xx, xy, yy]`, image pixels squared.
|
|
405
|
+
* @param scale - The gain applied to both semi-axes. Defaults to 1.
|
|
406
|
+
* @returns The ellipse, or `null` when the matrix is not finite and positive definite, or the
|
|
407
|
+
* scale is not a finite positive number: there is no ellipse to draw.
|
|
408
|
+
*/
|
|
409
|
+
function covarianceEllipse(cov, scale = 1) {
|
|
410
|
+
const [xx, xy, yy] = cov;
|
|
411
|
+
if (!Number.isFinite(xx + xy + yy) || !(Number.isFinite(scale) && scale > 0)) return null;
|
|
412
|
+
const det = xx * yy - xy * xy;
|
|
413
|
+
if (!(xx > 0 && yy > 0 && det > 0)) return null;
|
|
414
|
+
const major = .5 * (xx + yy) + Math.hypot(.5 * (xx - yy), xy);
|
|
415
|
+
const minor = det / major;
|
|
416
|
+
const half = .5 * Math.atan2(2 * xy, xx - yy);
|
|
417
|
+
const angle = half <= -Math.PI / 2 ? half + Math.PI : half;
|
|
418
|
+
return {
|
|
419
|
+
rx: scale * Math.sqrt(major),
|
|
420
|
+
ry: scale * Math.sqrt(minor),
|
|
421
|
+
angle
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* The ellipses of the uncertainty layer: each corner's position covariance as a 1σ ellipse,
|
|
426
|
+
* both semi-axes multiplied by `scale`, centred on the corner and sharing its id, in the `model`
|
|
427
|
+
* role. A corner with no covariance, or one that is not positive definite, has none.
|
|
428
|
+
*
|
|
429
|
+
* @param corners - The corners.
|
|
430
|
+
* @param scale - The gain on the semi-axes. A detector's σ is a fraction of a pixel, so it is
|
|
431
|
+
* drawn magnified; print the gain beside the image ("ellipses ×40").
|
|
432
|
+
* @returns One ellipse per corner with a drawable covariance, in order.
|
|
433
|
+
*/
|
|
434
|
+
function uncertaintyEllipses(corners, scale) {
|
|
435
|
+
const out = [];
|
|
436
|
+
for (const corner of corners) {
|
|
437
|
+
if (!corner.cov) continue;
|
|
438
|
+
const ellipse = covarianceEllipse(corner.cov, scale);
|
|
439
|
+
if (ellipse) out.push({
|
|
440
|
+
id: corner.id,
|
|
441
|
+
x: corner.x,
|
|
442
|
+
y: corner.y,
|
|
443
|
+
...ellipse,
|
|
444
|
+
role: "model"
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
return out;
|
|
448
|
+
}
|
|
396
449
|
//#endregion
|
|
397
450
|
//#region src/TargetOverlay.tsx
|
|
398
451
|
/**
|
|
@@ -412,6 +465,7 @@ function edgeBitEllipses(bits) {
|
|
|
412
465
|
* | `circles` | `PointSet` | ring; a centre dot marks black |
|
|
413
466
|
* | `rings` | `PointSet` + `EllipseSet` | fitted outer and inner ellipse, plus at the centre |
|
|
414
467
|
* | `edgeBits` | `EllipseSet` | dot on the edge: solid for 1, dashed for 0, opacity from confidence |
|
|
468
|
+
* | corners' `cov` | `EllipseSet` | with `uncertainty`: the 1σ ellipse × the scale, in `model` |
|
|
415
469
|
*/
|
|
416
470
|
/** The ids of each part, to route a hovered or selected id to the layers that have it. */
|
|
417
471
|
function idsByPart(detection) {
|
|
@@ -443,10 +497,12 @@ function dimPredicate(dimmed) {
|
|
|
443
497
|
* - **Callbacks** report `{ id, part }` with the id from the detection. A press and a hover move
|
|
444
498
|
* between layers (a corner, then the marker under it) without a flicker: the change is reported
|
|
445
499
|
* once.
|
|
500
|
+
* - **Uncertainty** (opt-in, `uncertainty`): each corner's covariance as a 1σ ellipse × the
|
|
501
|
+
* given scale, under the corners.
|
|
446
502
|
*
|
|
447
503
|
* The layers it renders carry their own accessible names ("Corners: 54 points, 0 selected").
|
|
448
504
|
*/
|
|
449
|
-
function TargetOverlay({ detection, showEdges = true, showLabels = true, hoveredId, selectedIds, onHoverChange, onItemPress, dimmed, layerIdPrefix }) {
|
|
505
|
+
function TargetOverlay({ detection, showEdges = true, showLabels = true, hoveredId, selectedIds, onHoverChange, onItemPress, dimmed, uncertainty, layerIdPrefix }) {
|
|
450
506
|
const nodes = useMemo(() => cornerNodes(detection), [detection]);
|
|
451
507
|
const areas = useMemo(() => markerAreas(detection), [detection]);
|
|
452
508
|
const circles = useMemo(() => circlePoints(detection), [detection]);
|
|
@@ -454,6 +510,8 @@ function TargetOverlay({ detection, showEdges = true, showLabels = true, hovered
|
|
|
454
510
|
const ringPoints = useMemo(() => ringCentres(rings ?? []), [rings]);
|
|
455
511
|
const ringShapes = useMemo(() => ringEllipses(rings ?? []), [rings]);
|
|
456
512
|
const bits = useMemo(() => edgeBitEllipses(detection.edgeBits ?? []), [detection.edgeBits]);
|
|
513
|
+
const uncertaintyScale = uncertainty?.scale;
|
|
514
|
+
const covEllipses = useMemo(() => uncertaintyScale === void 0 ? [] : uncertaintyEllipses(detection.corners ?? [], uncertaintyScale), [detection.corners, uncertaintyScale]);
|
|
457
515
|
const ids = useMemo(() => idsByPart(detection), [detection]);
|
|
458
516
|
const selectedSet = useMemo(() => new Set(selectedIds ?? []), [selectedIds]);
|
|
459
517
|
const selected = useMemo(() => {
|
|
@@ -555,6 +613,15 @@ function TargetOverlay({ detection, showEdges = true, showLabels = true, hovered
|
|
|
555
613
|
label: "Rings"
|
|
556
614
|
})
|
|
557
615
|
] }),
|
|
616
|
+
covEllipses.length > 0 && /* @__PURE__ */ jsx(EllipseSet$1, {
|
|
617
|
+
items: covEllipses,
|
|
618
|
+
role: "model",
|
|
619
|
+
hoveredId: hoverOf("corner"),
|
|
620
|
+
selectedIds: selected.corner,
|
|
621
|
+
dimmed: isDimmed,
|
|
622
|
+
pickable: false,
|
|
623
|
+
label: `Position uncertainty: 1σ ellipses ×${uncertaintyScale}`
|
|
624
|
+
}),
|
|
558
625
|
hasCorners && /* @__PURE__ */ jsx(GridLayer, {
|
|
559
626
|
nodes,
|
|
560
627
|
markers: TARGET_MARKERS,
|
|
@@ -646,6 +713,165 @@ function edgeBitsFromPuzzleboard(edges, corners, alignment, period = 501) {
|
|
|
646
713
|
return out;
|
|
647
714
|
}
|
|
648
715
|
//#endregion
|
|
649
|
-
|
|
716
|
+
//#region src/calibTargets.ts
|
|
717
|
+
/** The overlay kind of each calib-targets result kind. */
|
|
718
|
+
const OVERLAY_KIND = {
|
|
719
|
+
corners: "corners",
|
|
720
|
+
chessboard: "chessboard",
|
|
721
|
+
charuco: "charuco",
|
|
722
|
+
markerboard: "markerboard",
|
|
723
|
+
puzzleboard: "puzzleboard",
|
|
724
|
+
puzzlepole: "puzzleboard"
|
|
725
|
+
};
|
|
726
|
+
/** A covariance as `TargetCorner.cov`, or `undefined` when there is none or it is not finite. */
|
|
727
|
+
function covOf(cov) {
|
|
728
|
+
if (!cov) return void 0;
|
|
729
|
+
const { xx, xy, yy } = cov;
|
|
730
|
+
return Number.isFinite(xx + xy + yy) ? [
|
|
731
|
+
xx,
|
|
732
|
+
xy,
|
|
733
|
+
yy
|
|
734
|
+
] : void 0;
|
|
735
|
+
}
|
|
736
|
+
/** A labelled corner as a `TargetCorner`, id `corner-<index>`; `(u, v)` becomes `(i, j)`. */
|
|
737
|
+
function labeledCorner(corner, index) {
|
|
738
|
+
const out = {
|
|
739
|
+
id: `corner-${index}`,
|
|
740
|
+
x: corner.position[0],
|
|
741
|
+
y: corner.position[1],
|
|
742
|
+
score: corner.score
|
|
743
|
+
};
|
|
744
|
+
if (corner.grid) {
|
|
745
|
+
out.i = corner.grid.u;
|
|
746
|
+
out.j = corner.grid.v;
|
|
747
|
+
}
|
|
748
|
+
const cov = covOf(corner.position_covariance);
|
|
749
|
+
if (cov) out.cov = cov;
|
|
750
|
+
return out;
|
|
751
|
+
}
|
|
752
|
+
/** A raw corner as a `TargetCorner` with both axis directions, id `corner-<index>`, labelled with its index. */
|
|
753
|
+
function rawCorner(corner, index) {
|
|
754
|
+
const out = {
|
|
755
|
+
id: `corner-${index}`,
|
|
756
|
+
x: corner.position[0],
|
|
757
|
+
y: corner.position[1],
|
|
758
|
+
score: corner.strength,
|
|
759
|
+
angle: corner.axes[0].angle,
|
|
760
|
+
angle2: corner.axes[1].angle,
|
|
761
|
+
label: String(index)
|
|
762
|
+
};
|
|
763
|
+
const cov = covOf(corner.position_covariance);
|
|
764
|
+
if (cov) out.cov = cov;
|
|
765
|
+
return out;
|
|
766
|
+
}
|
|
767
|
+
/** The markers with a projected quad, id `marker-<index>`, labelled with the dictionary id. */
|
|
768
|
+
function markersOf(markers) {
|
|
769
|
+
const out = [];
|
|
770
|
+
markers.forEach((marker, index) => {
|
|
771
|
+
if (!marker.corners_img) return;
|
|
772
|
+
out.push({
|
|
773
|
+
id: `marker-${index}`,
|
|
774
|
+
corners: marker.corners_img.flatMap(([x, y]) => [x, y]),
|
|
775
|
+
label: String(marker.id)
|
|
776
|
+
});
|
|
777
|
+
});
|
|
778
|
+
return out;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* The matched circles of a marker board, id `circle-<index>` (index into `circle_matches`): at
|
|
782
|
+
* the matched candidate's centre, with the board's cell and printed polarity. An unmatched board
|
|
783
|
+
* circle is not drawn, nor is a candidate no board circle matched.
|
|
784
|
+
*/
|
|
785
|
+
function circlesOf(diagnostics) {
|
|
786
|
+
const out = [];
|
|
787
|
+
diagnostics.circle_matches.forEach((match, index) => {
|
|
788
|
+
const candidate = match.matched_index === null ? void 0 : diagnostics.circle_candidates[match.matched_index];
|
|
789
|
+
if (!candidate) return;
|
|
790
|
+
out.push({
|
|
791
|
+
id: `circle-${index}`,
|
|
792
|
+
x: candidate.center_img[0],
|
|
793
|
+
y: candidate.center_img[1],
|
|
794
|
+
polarity: match.expected.polarity,
|
|
795
|
+
i: match.expected.cell.i,
|
|
796
|
+
j: match.expected.cell.j
|
|
797
|
+
});
|
|
798
|
+
});
|
|
799
|
+
return out;
|
|
800
|
+
}
|
|
801
|
+
/** The observed edges as `edgeBitsFromPuzzleboard` takes them: a nonzero bit is 1. */
|
|
802
|
+
function edgesOf(edges) {
|
|
803
|
+
return edges.map((edge) => ({
|
|
804
|
+
row: edge.row,
|
|
805
|
+
col: edge.col,
|
|
806
|
+
orientation: edge.orientation,
|
|
807
|
+
bit: edge.bit === 0 ? 0 : 1,
|
|
808
|
+
confidence: edge.confidence
|
|
809
|
+
}));
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* The `TargetDetection` of a calib-targets result.
|
|
813
|
+
*
|
|
814
|
+
* - **Kinds.** `chessboard`, `charuco`, `markerboard`, `puzzleboard` and raw `corners` map to the
|
|
815
|
+
* overlay kind of the same name; a `puzzlepole` is drawn as a `puzzleboard` lattice.
|
|
816
|
+
* - **Corners.** Positions pass through unchanged (calib-targets reports the centre of pixel `i`
|
|
817
|
+
* at `i`, as the overlay expects). A labelled corner's grid `(u, v)` becomes `(i, j)`, so a
|
|
818
|
+
* board draws its lattice and labels corners `i,j`. A raw corner draws its two axes (`angle`,
|
|
819
|
+
* `angle2`) and is labelled with its index; its `strength` is the `score`.
|
|
820
|
+
* - **Covariance.** A corner's `position_covariance`, when present and finite, becomes `cov`;
|
|
821
|
+
* `TargetOverlay` draws it with `uncertainty`.
|
|
822
|
+
* - **Markers** (ChArUco) are the quads of `corners_img`, labelled with the dictionary id; a
|
|
823
|
+
* marker without a projected quad is left out.
|
|
824
|
+
* - **Circles** (marker board, from `diagnostics`) are the board circles a candidate matched,
|
|
825
|
+
* at the candidate's centre with the board's cell and polarity.
|
|
826
|
+
* - **Edge bits** (PuzzleBoard, from `diagnostics`) are the observed edges placed through the
|
|
827
|
+
* alignment with `edgeBitsFromPuzzleboard`.
|
|
828
|
+
*
|
|
829
|
+
* Ids are `corner-<n>`, `marker-<n>` and `circle-<n>`, where `n` is the index into the result's
|
|
830
|
+
* `corners`, `markers` or `circle_matches`, so a hover or a press maps straight back to it.
|
|
831
|
+
*
|
|
832
|
+
* @param result - The result, tagged with its kind.
|
|
833
|
+
* @returns The detection for `TargetOverlay`. Parts with no items are left out.
|
|
834
|
+
*/
|
|
835
|
+
function fromCalibTargets(result) {
|
|
836
|
+
const detection = { kind: OVERLAY_KIND[result.kind] };
|
|
837
|
+
if (result.kind === "corners") {
|
|
838
|
+
if (result.corners.length > 0) detection.corners = result.corners.map(rawCorner);
|
|
839
|
+
return detection;
|
|
840
|
+
}
|
|
841
|
+
if (!result.detection) return detection;
|
|
842
|
+
const corners = result.detection.corners.map(labeledCorner);
|
|
843
|
+
if (corners.length > 0) detection.corners = corners;
|
|
844
|
+
switch (result.kind) {
|
|
845
|
+
case "charuco": {
|
|
846
|
+
const markers = markersOf(result.detection.markers);
|
|
847
|
+
if (markers.length > 0) detection.markers = markers;
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
case "markerboard": {
|
|
851
|
+
const circles = result.diagnostics ? circlesOf(result.diagnostics) : [];
|
|
852
|
+
if (circles.length > 0) detection.circles = circles;
|
|
853
|
+
break;
|
|
854
|
+
}
|
|
855
|
+
case "puzzleboard": {
|
|
856
|
+
if (!result.diagnostics) break;
|
|
857
|
+
const { matrix, translation } = result.detection.alignment;
|
|
858
|
+
const alignment = {
|
|
859
|
+
transform: {
|
|
860
|
+
a: matrix[0][0],
|
|
861
|
+
b: matrix[0][1],
|
|
862
|
+
c: matrix[1][0],
|
|
863
|
+
d: matrix[1][1]
|
|
864
|
+
},
|
|
865
|
+
translation: [translation[0], translation[1]]
|
|
866
|
+
};
|
|
867
|
+
const edgeBits = edgeBitsFromPuzzleboard(edgesOf(result.diagnostics.observed_edges), corners, alignment);
|
|
868
|
+
if (edgeBits.length > 0) detection.edgeBits = edgeBits;
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return detection;
|
|
873
|
+
}
|
|
874
|
+
//#endregion
|
|
875
|
+
export { EllipseSet, PUZZLEBOARD_PERIOD, TARGET_KINDS, TARGET_MARKERS, TargetOverlay, circlePoints, cornerGrid, cornerNodes, covarianceEllipse, edgeBitEllipses, edgeBitsFromPuzzleboard, ellipsePath, fromCalibTargets, gridEdges, gridKey, idByGrid, isLatticeKind, markerAreas, markerPolygons, ringCentres, ringEllipses, uncertaintyEllipses };
|
|
650
876
|
|
|
651
877
|
//# sourceMappingURL=index.js.map
|