@kubohiroya/turbowarp-camera-source 0.6.0 → 0.8.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.ja.md +51 -3
- package/README.md +174 -11
- package/dist/calibration/adaptation.d.ts +64 -0
- package/dist/calibration/adaptation.d.ts.map +1 -0
- package/dist/calibration/adaptation.js +111 -0
- package/dist/calibration/adaptation.js.map +1 -0
- package/dist/calibration/compatibility.d.ts +44 -0
- package/dist/calibration/compatibility.d.ts.map +1 -0
- package/dist/calibration/compatibility.js +95 -0
- package/dist/calibration/compatibility.js.map +1 -0
- package/dist/calibration/conditions.d.ts +67 -0
- package/dist/calibration/conditions.d.ts.map +1 -0
- package/dist/calibration/conditions.js +61 -0
- package/dist/calibration/conditions.js.map +1 -0
- package/dist/calibration/types.d.ts +135 -0
- package/dist/calibration/types.d.ts.map +1 -0
- package/dist/calibration/types.js +13 -0
- package/dist/calibration/types.js.map +1 -0
- package/dist/camera-source.js +1174 -44
- package/dist/extension-manifest.json +119 -3
- package/dist/flip.d.ts +24 -0
- package/dist/flip.d.ts.map +1 -0
- package/dist/flip.js +33 -0
- package/dist/flip.js.map +1 -0
- package/dist/runtime-capability.d.ts +70 -0
- package/dist/runtime-capability.d.ts.map +1 -0
- package/dist/runtime-capability.js +26 -0
- package/dist/runtime-capability.js.map +1 -0
- package/dist/runtime.d.ts +111 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +63 -0
- package/dist/runtime.js.map +1 -0
- package/package.json +27 -19
- package/schemas/camera-intrinsics-v1.json +346 -0
- package/schemas/extension-manifest.schema.json +49 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** Zoom readings are device-reported floats; compare them with a tolerance rather than exactly. */
|
|
2
|
+
const ZOOM_TOLERANCE = 1e-6;
|
|
3
|
+
const FOCUS_DISTANCE_TOLERANCE = 1e-6;
|
|
4
|
+
function finding(code, state, decisive, detail) {
|
|
5
|
+
return { code, state, decisive, detail };
|
|
6
|
+
}
|
|
7
|
+
function describe(value) {
|
|
8
|
+
return value === undefined ? 'not reported' : String(value);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Compares one optical member.
|
|
12
|
+
*
|
|
13
|
+
* Absent on both sides is agreement, not ignorance: the device reported no such control when the
|
|
14
|
+
* calibration was solved and reports none now. Present on one side only is a change nobody can
|
|
15
|
+
* quantify, so it is left unknown rather than guessed in either direction.
|
|
16
|
+
*/
|
|
17
|
+
function compareMember(code, name, recorded, observed, equal) {
|
|
18
|
+
if (recorded === undefined && observed === undefined) {
|
|
19
|
+
return finding(code, 'matched', true, `Neither the profile nor the camera reports ${name}.`);
|
|
20
|
+
}
|
|
21
|
+
if (recorded === undefined || observed === undefined) {
|
|
22
|
+
return finding(code, 'unknown', true, `${name} is ${describe(recorded)} in the profile and ${describe(observed)} now, so the two cannot be compared.`);
|
|
23
|
+
}
|
|
24
|
+
const same = equal(recorded, observed);
|
|
25
|
+
return finding(code, same ? 'matched' : 'mismatched', true, same
|
|
26
|
+
? `${name} is ${describe(observed)} in both.`
|
|
27
|
+
: `${name} was ${describe(recorded)} at calibration and is ${describe(observed)} now.`);
|
|
28
|
+
}
|
|
29
|
+
const sameText = (left, right) => left === right;
|
|
30
|
+
const nearlyEqual = (tolerance) => (left, right) => Math.abs(left - right) <= tolerance;
|
|
31
|
+
function captureFindings(capture, conditions) {
|
|
32
|
+
return [
|
|
33
|
+
compareMember('resize-mode', 'Resize mode', capture.resizeMode, conditions.resizeMode, sameText),
|
|
34
|
+
compareMember('zoom', 'Zoom', capture.zoom, conditions.zoom, nearlyEqual(ZOOM_TOLERANCE)),
|
|
35
|
+
compareMember('focus-mode', 'Focus mode', capture.focusMode, conditions.focusMode, sameText),
|
|
36
|
+
compareMember('focus-distance', 'Focus distance', capture.focusDistance, conditions.focusDistance, nearlyEqual(FOCUS_DISTANCE_TOLERANCE))
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
function imageSizeFinding(profile, conditions) {
|
|
40
|
+
const expected = `${profile.image.width}x${profile.image.height}`;
|
|
41
|
+
if (conditions.width === 0 || conditions.height === 0) {
|
|
42
|
+
return finding('image-size', 'unknown', true, `The camera has delivered no frame yet, so its size cannot be compared with the calibrated ${expected}.`);
|
|
43
|
+
}
|
|
44
|
+
const actual = `${conditions.width}x${conditions.height}`;
|
|
45
|
+
return actual === expected
|
|
46
|
+
? finding('image-size', 'matched', true, `The frame is ${actual}, as calibrated.`)
|
|
47
|
+
: finding('image-size', 'mismatched', true, `The calibration was solved at ${expected} and the camera now delivers ${actual}.`);
|
|
48
|
+
}
|
|
49
|
+
function deviceFindings(profile, conditions) {
|
|
50
|
+
const recordedLabel = profile.device?.label;
|
|
51
|
+
const observedLabel = conditions.label;
|
|
52
|
+
const label = recordedLabel !== undefined && observedLabel !== undefined
|
|
53
|
+
? finding('device-label', recordedLabel === observedLabel ? 'matched' : 'mismatched', true, recordedLabel === observedLabel
|
|
54
|
+
? `The camera still reports itself as ${observedLabel}.`
|
|
55
|
+
: `The profile was solved on ${recordedLabel} and the camera now reports ${observedLabel}.`)
|
|
56
|
+
: finding('device-label', 'unknown', false, 'A device label is missing on one side, which is normal before the browser grants camera permission.');
|
|
57
|
+
const recordedId = profile.device?.deviceId;
|
|
58
|
+
const observedId = conditions.deviceId.length === 0 ? undefined : conditions.deviceId;
|
|
59
|
+
const identity = finding('device-id', recordedId !== undefined && observedId !== undefined && recordedId === observedId
|
|
60
|
+
? 'matched'
|
|
61
|
+
: 'unknown', false, 'A device id is scoped to one browser and profile, so it changes without the camera changing. It is a hint for ordering candidates, never proof of identity.');
|
|
62
|
+
return [label, identity];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Judges a profile against the conditions a camera reports.
|
|
66
|
+
*
|
|
67
|
+
* The verdict is `incompatible` when any decisive finding mismatched, `undetermined` when any
|
|
68
|
+
* decisive finding could not be settled, and `compatible` only when every decisive finding matched.
|
|
69
|
+
* Unknown never resolves upward into `compatible`.
|
|
70
|
+
*/
|
|
71
|
+
export function evaluateProfileCompatibility(profile, conditions) {
|
|
72
|
+
const findings = [imageSizeFinding(profile, conditions)];
|
|
73
|
+
if (profile.image.undistorted) {
|
|
74
|
+
findings.push(finding('undistorted-frames', 'unknown', true, 'The profile describes already undistorted images. This extension hands over the camera frames as captured and cannot confirm that something upstream corrects them.'));
|
|
75
|
+
}
|
|
76
|
+
if (profile.capture === undefined) {
|
|
77
|
+
findings.push(finding('capture-conditions', 'unknown', true, 'The profile records no capture conditions, so whether the optics are configured as they were at calibration cannot be decided.'));
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
findings.push(...captureFindings(profile.capture, conditions));
|
|
81
|
+
}
|
|
82
|
+
findings.push(finding('frame-rate', 'matched', false, `Frame rate was ${describe(profile.capture?.frameRate)} at calibration and is ${describe(conditions.frameRate)} now. It does not change how the lens projects.`), finding('facing-mode', 'matched', false, `Facing mode was ${describe(profile.capture?.facingMode)} at calibration and is ${describe(conditions.facingMode)} now.`), ...deviceFindings(profile, conditions));
|
|
83
|
+
const decisive = findings.filter((entry) => entry.decisive);
|
|
84
|
+
const state = decisive.some((entry) => entry.state === 'mismatched')
|
|
85
|
+
? 'incompatible'
|
|
86
|
+
: decisive.some((entry) => entry.state === 'unknown')
|
|
87
|
+
? 'undetermined'
|
|
88
|
+
: 'compatible';
|
|
89
|
+
return { state, findings };
|
|
90
|
+
}
|
|
91
|
+
/** The findings that decided the verdict, in the order they were made. */
|
|
92
|
+
export function decisiveFindings(report) {
|
|
93
|
+
return report.findings.filter((entry) => entry.decisive && entry.state !== 'matched');
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../src/calibration/compatibility.ts"],"names":[],"mappings":"AAkDA,mGAAmG;AACnG,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,wB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KAAK,KAAK,YAAY,CAAC;QACtF,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC;YACnD,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,YAAY,CAAC;IAEnB,OAAO,EAAC,KAAK,EAAE,QAAQ,EAAC,CAAC;AAC3B,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,gBAAgB,CAAC,MAA2B;IAC1D,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { Flip } from '../flip.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the running camera reports about how it is capturing right now.
|
|
4
|
+
*
|
|
5
|
+
* This is the other half of a compatibility check: a stored profile describes the conditions a
|
|
6
|
+
* calibration was solved under, and these are the conditions in front of us. Both are read from the
|
|
7
|
+
* same `MediaTrackSettings` vocabulary so the two can be compared member by member.
|
|
8
|
+
*
|
|
9
|
+
* A member is absent when the device does not report that control at all, which is different from
|
|
10
|
+
* the control being present with an unremarkable value. The comparison depends on that difference,
|
|
11
|
+
* so nothing here substitutes a default for a missing reading.
|
|
12
|
+
*/
|
|
13
|
+
import type { CalibrationCapture } from './types.js';
|
|
14
|
+
export interface CameraConditions {
|
|
15
|
+
/** Pixel size of the delivered frame, or zero while no frame has arrived. */
|
|
16
|
+
readonly width: number;
|
|
17
|
+
readonly height: number;
|
|
18
|
+
readonly deviceId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the stage preview is drawn flipped.
|
|
21
|
+
*
|
|
22
|
+
* Display only. The frames handed to a consumer are the camera's own capture either way, so this
|
|
23
|
+
* never takes part in a compatibility decision — it is carried so that a caller rendering the
|
|
24
|
+
* frame knows what the operator is looking at.
|
|
25
|
+
*/
|
|
26
|
+
readonly previewFlip: Flip;
|
|
27
|
+
readonly label?: string;
|
|
28
|
+
readonly frameRate?: number;
|
|
29
|
+
readonly facingMode?: string;
|
|
30
|
+
readonly resizeMode?: string;
|
|
31
|
+
readonly zoom?: number;
|
|
32
|
+
readonly focusMode?: string;
|
|
33
|
+
readonly focusDistance?: number;
|
|
34
|
+
}
|
|
35
|
+
/** The subset of `MediaTrackSettings` this extension reads, narrowed to what it actually uses. */
|
|
36
|
+
export interface TrackSettingsLike {
|
|
37
|
+
readonly deviceId?: unknown;
|
|
38
|
+
readonly frameRate?: unknown;
|
|
39
|
+
readonly facingMode?: unknown;
|
|
40
|
+
readonly resizeMode?: unknown;
|
|
41
|
+
readonly zoom?: unknown;
|
|
42
|
+
readonly focusMode?: unknown;
|
|
43
|
+
readonly focusDistance?: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface FrameGeometry {
|
|
46
|
+
readonly width: number;
|
|
47
|
+
readonly height: number;
|
|
48
|
+
readonly previewFlip: Flip;
|
|
49
|
+
readonly deviceId: string;
|
|
50
|
+
readonly label?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Builds the conditions record.
|
|
54
|
+
*
|
|
55
|
+
* Frame size comes from the delivered frame rather than from the track settings: a track can report
|
|
56
|
+
* a requested size that the browser then satisfies with something else, and the number a consumer
|
|
57
|
+
* has to match its intrinsics against is the size of the image it is actually handed.
|
|
58
|
+
*/
|
|
59
|
+
export declare function readCameraConditions(frame: FrameGeometry, settings?: TrackSettingsLike): CameraConditions;
|
|
60
|
+
/**
|
|
61
|
+
* Renders the optical part of the current conditions in the shape a profile stores.
|
|
62
|
+
*
|
|
63
|
+
* A producer solving a calibration right now uses this to record what the camera was doing, so the
|
|
64
|
+
* document it writes can later be compared against a fresh reading of the same members.
|
|
65
|
+
*/
|
|
66
|
+
export declare function captureFromConditions(conditions: CameraConditions): CalibrationCapture;
|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,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAoBD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,EACpB,QAAQ,GAAE,iBAAsB,GAC/B,gBAAgB,CAqBlB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,gBAAgB,GAAG,kBAAkB,CAStF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
function positiveNumber(value) {
|
|
2
|
+
return typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : undefined;
|
|
3
|
+
}
|
|
4
|
+
function nonNegativeNumber(value) {
|
|
5
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : undefined;
|
|
6
|
+
}
|
|
7
|
+
function nonEmptyText(value) {
|
|
8
|
+
if (typeof value !== 'string')
|
|
9
|
+
return undefined;
|
|
10
|
+
const text = value.trim();
|
|
11
|
+
return text.length === 0 ? undefined : text;
|
|
12
|
+
}
|
|
13
|
+
function pixelCount(value) {
|
|
14
|
+
return Number.isFinite(value) && value > 0 ? Math.round(value) : 0;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Builds the conditions record.
|
|
18
|
+
*
|
|
19
|
+
* Frame size comes from the delivered frame rather than from the track settings: a track can report
|
|
20
|
+
* a requested size that the browser then satisfies with something else, and the number a consumer
|
|
21
|
+
* has to match its intrinsics against is the size of the image it is actually handed.
|
|
22
|
+
*/
|
|
23
|
+
export function readCameraConditions(frame, settings = {}) {
|
|
24
|
+
const label = nonEmptyText(frame.label);
|
|
25
|
+
const frameRate = positiveNumber(settings.frameRate);
|
|
26
|
+
const facingMode = nonEmptyText(settings.facingMode);
|
|
27
|
+
const resizeMode = nonEmptyText(settings.resizeMode);
|
|
28
|
+
const zoom = positiveNumber(settings.zoom);
|
|
29
|
+
const focusMode = nonEmptyText(settings.focusMode);
|
|
30
|
+
const focusDistance = nonNegativeNumber(settings.focusDistance);
|
|
31
|
+
return {
|
|
32
|
+
width: pixelCount(frame.width),
|
|
33
|
+
height: pixelCount(frame.height),
|
|
34
|
+
deviceId: nonEmptyText(frame.deviceId) ?? nonEmptyText(settings.deviceId) ?? '',
|
|
35
|
+
previewFlip: frame.previewFlip,
|
|
36
|
+
...(label === undefined ? {} : { label }),
|
|
37
|
+
...(frameRate === undefined ? {} : { frameRate }),
|
|
38
|
+
...(facingMode === undefined ? {} : { facingMode }),
|
|
39
|
+
...(resizeMode === undefined ? {} : { resizeMode }),
|
|
40
|
+
...(zoom === undefined ? {} : { zoom }),
|
|
41
|
+
...(focusMode === undefined ? {} : { focusMode }),
|
|
42
|
+
...(focusDistance === undefined ? {} : { focusDistance })
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Renders the optical part of the current conditions in the shape a profile stores.
|
|
47
|
+
*
|
|
48
|
+
* A producer solving a calibration right now uses this to record what the camera was doing, so the
|
|
49
|
+
* document it writes can later be compared against a fresh reading of the same members.
|
|
50
|
+
*/
|
|
51
|
+
export function captureFromConditions(conditions) {
|
|
52
|
+
return {
|
|
53
|
+
...(conditions.frameRate === undefined ? {} : { frameRate: conditions.frameRate }),
|
|
54
|
+
...(conditions.facingMode === undefined ? {} : { facingMode: conditions.facingMode }),
|
|
55
|
+
...(conditions.resizeMode === undefined ? {} : { resizeMode: conditions.resizeMode }),
|
|
56
|
+
...(conditions.zoom === undefined ? {} : { zoom: conditions.zoom }),
|
|
57
|
+
...(conditions.focusMode === undefined ? {} : { focusMode: conditions.focusMode }),
|
|
58
|
+
...(conditions.focusDistance === undefined ? {} : { focusDistance: conditions.focusDistance })
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=conditions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions.js","sourceRoot":"","sources":["../../src/calibration/conditions.ts"],"names":[],"mappings":"AAuDA,SAAS,cAAc,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9F,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/F,CAAC;AAED,SAAS,YAAY,CAAC,KAAc;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,KAAoB,EACpB,WAA8B,EAAE;IAEhC,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,SAAS,GAAG,cAAc,C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,CAAC,EAAC,SAAS,EAAC,CAAC;QAC/C,GAAG,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,aAAa,EAAC,CAAC;KACxD,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAA4B;IAChE,OAAO;QACL,GAAG,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAC,CAAC;QAChF,GAAG,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAC,CAAC;QACnF,GAAG,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,UAAU,CAAC,UAAU,EAAC,CAAC;QACnF,GAAG,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAC,CAAC;QACjE,GAAG,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAC,CAAC;QAChF,GAAG,CAAC,UAAU,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAC,aAAa,EAAE,UAAU,CAAC,aAAa,EAAC,CAAC;KAC7F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The intrinsic calibration profile contract.
|
|
3
|
+
*
|
|
4
|
+
* A profile describes how one camera projects the world onto its own captured image. It says nothing
|
|
5
|
+
* about where that camera stands: the pose of a camera in a shared world frame belongs to whichever
|
|
6
|
+
* extension solves placement, and mixing the two into one document is what made the earlier
|
|
7
|
+
* `twrmc/camera-calibration` format unusable for anything but the application it came from.
|
|
8
|
+
*
|
|
9
|
+
* Camera Source owns the contract but never produces a profile. Chessboard calibration, an operator
|
|
10
|
+
* supplying JSON, or a future calibrator are all just producers of a document that passes validation.
|
|
11
|
+
*/
|
|
12
|
+
/** Projection model of the lens. Version 1 defines the pinhole model only. */
|
|
13
|
+
export type CameraModel = 'pinhole';
|
|
14
|
+
/**
|
|
15
|
+
* Lens distortion model.
|
|
16
|
+
*
|
|
17
|
+
* `brown-conrady` carries the OpenCV radial and tangential coefficients in their usual order
|
|
18
|
+
* (k1, k2, p1, p2 with optional k3, and k4-k6 for the rational model). `kannala-brandt` carries the
|
|
19
|
+
* four fisheye coefficients. `none` means the image is free of lens distortion.
|
|
20
|
+
*/
|
|
21
|
+
export type DistortionModel = 'none' | 'brown-conrady' | 'kannala-brandt';
|
|
22
|
+
/**
|
|
23
|
+
* The pinhole parameters, in pixels of the calibration image.
|
|
24
|
+
*
|
|
25
|
+
* Named rather than packed into a matrix because a nine-number array cannot say whether it is stored
|
|
26
|
+
* row-major or column-major, and a reader that guesses wrong produces a plausible, wrong projection.
|
|
27
|
+
* The equivalent row-major 3x3 matrix is `[fx, skew, cx, 0, fy, cy, 0, 0, 1]`.
|
|
28
|
+
*
|
|
29
|
+
* Pixel coordinates run from the top-left corner of the image, x to the right and y downward.
|
|
30
|
+
*/
|
|
31
|
+
export interface CameraIntrinsics {
|
|
32
|
+
readonly fx: number;
|
|
33
|
+
readonly fy: number;
|
|
34
|
+
readonly cx: number;
|
|
35
|
+
readonly cy: number;
|
|
36
|
+
/** Axis skew. Zero for every square-pixel sensor; kept explicit so it is never assumed. */
|
|
37
|
+
readonly skew: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CameraDistortion {
|
|
40
|
+
readonly model: DistortionModel;
|
|
41
|
+
readonly coefficients: readonly number[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The image the calibration was solved against.
|
|
45
|
+
*
|
|
46
|
+
* `undistorted` is false for the base contract: a profile describes the raw captured frame, and a
|
|
47
|
+
* consumer applies the distortion model itself. A producer that hands over already corrected images
|
|
48
|
+
* sets it to true, which then requires the intrinsics to describe the corrected image and forbids
|
|
49
|
+
* leftover distortion coefficients.
|
|
50
|
+
*
|
|
51
|
+
* The image is always the camera's own capture. Preview mirroring is a display choice made by
|
|
52
|
+
* whoever shows the frame and never changes the calibration.
|
|
53
|
+
*/
|
|
54
|
+
export interface CalibrationImage {
|
|
55
|
+
readonly width: number;
|
|
56
|
+
readonly height: number;
|
|
57
|
+
readonly undistorted: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* How good the calibration is.
|
|
61
|
+
*
|
|
62
|
+
* Optional, because a profile can arrive from a producer that does not report it — an operator's
|
|
63
|
+
* hand-written JSON, or the legacy format, which carried no quality fields at all. Absent means
|
|
64
|
+
* unknown. A consumer that needs a quality bound must treat absence as unknown and say so, rather
|
|
65
|
+
* than reading it as a measured zero.
|
|
66
|
+
*/
|
|
67
|
+
export interface CalibrationQuality {
|
|
68
|
+
readonly sampleCount: number;
|
|
69
|
+
readonly reprojectionErrorPx: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Hints for recognizing the physical camera again.
|
|
73
|
+
*
|
|
74
|
+
* `deviceId` is a hint and not an identity: browsers scope it per origin and per profile, so it
|
|
75
|
+
* changes without the camera changing. Matching is done on the operator-assigned `cameraId`.
|
|
76
|
+
*/
|
|
77
|
+
export interface CalibrationDeviceHint {
|
|
78
|
+
readonly label?: string;
|
|
79
|
+
readonly deviceId?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The capture configuration the calibration was solved under.
|
|
83
|
+
*
|
|
84
|
+
* Optional as a whole, and optional member by member, but the difference between the two matters.
|
|
85
|
+
* When the block is absent nothing was recorded and compatibility cannot be decided. When it is
|
|
86
|
+
* present, a member that is absent means the device reported no such control at calibration time,
|
|
87
|
+
* which is something a later check can compare against.
|
|
88
|
+
*
|
|
89
|
+
* `frameRate` and `facingMode` are recorded for the operator; neither changes how the lens projects,
|
|
90
|
+
* so neither decides compatibility.
|
|
91
|
+
*/
|
|
92
|
+
export interface CalibrationCapture {
|
|
93
|
+
readonly frameRate?: number;
|
|
94
|
+
readonly facingMode?: string;
|
|
95
|
+
/** `none` or `crop-and-scale`. Cropping changes the effective intrinsics at the same resolution. */
|
|
96
|
+
readonly resizeMode?: string;
|
|
97
|
+
readonly zoom?: number;
|
|
98
|
+
/** `none`, `manual`, `single-shot` or `continuous`. */
|
|
99
|
+
readonly focusMode?: string;
|
|
100
|
+
readonly focusDistance?: number;
|
|
101
|
+
}
|
|
102
|
+
export interface CameraIntrinsicProfileV1 {
|
|
103
|
+
readonly schema: 'twcs/camera-intrinsics';
|
|
104
|
+
readonly version: 1;
|
|
105
|
+
/** Identifies this calibration run. A new solve produces a new id. */
|
|
106
|
+
readonly profileId: string;
|
|
107
|
+
/** The operator-assigned camera name, such as `stage-left`. Stable across calibration runs. */
|
|
108
|
+
readonly cameraId: string;
|
|
109
|
+
/** When the calibration was solved, as an RFC 3339 timestamp in UTC. */
|
|
110
|
+
readonly calibratedAt: string;
|
|
111
|
+
/** Free text naming whatever produced the profile. Recorded for diagnostics only. */
|
|
112
|
+
readonly producer: string;
|
|
113
|
+
readonly cameraModel: CameraModel;
|
|
114
|
+
readonly image: CalibrationImage;
|
|
115
|
+
readonly intrinsics: CameraIntrinsics;
|
|
116
|
+
readonly distortion: CameraDistortion;
|
|
117
|
+
readonly capture?: CalibrationCapture;
|
|
118
|
+
readonly quality?: CalibrationQuality;
|
|
119
|
+
readonly device?: CalibrationDeviceHint;
|
|
120
|
+
}
|
|
121
|
+
export type ProfileErrorCode = 'not-an-object' | 'unsupported-schema' | 'unsupported-version' | 'missing-field' | 'unexpected-field' | 'invalid-type' | 'invalid-value' | 'out-of-range' | 'invalid-distortion' | 'inconsistent-profile' | 'forbidden-field';
|
|
122
|
+
export interface ProfileError {
|
|
123
|
+
readonly code: ProfileErrorCode;
|
|
124
|
+
/** Dotted path to the offending member, or an empty string for the document itself. */
|
|
125
|
+
readonly path: string;
|
|
126
|
+
readonly message: string;
|
|
127
|
+
}
|
|
128
|
+
export type ProfileResult = {
|
|
129
|
+
readonly ok: true;
|
|
130
|
+
readonly profile: CameraIntrinsicProfileV1;
|
|
131
|
+
} | {
|
|
132
|
+
readonly ok: false;
|
|
133
|
+
readonly error: ProfileError;
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/calibration/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAA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UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAC;CACzC;AAED,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,oBAAoB,GACpB,qBAAqB,GACrB,eAAe,GACf,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,iBAAiB,CAAC;AAEtB,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GACrB;IAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAA;CAAC,GAC/D;IAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The intrinsic calibration profile contract.
|
|
3
|
+
*
|
|
4
|
+
* A profile describes how one camera projects the world onto its own captured image. It says nothing
|
|
5
|
+
* about where that camera stands: the pose of a camera in a shared world frame belongs to whichever
|
|
6
|
+
* extension solves placement, and mixing the two into one document is what made the earlier
|
|
7
|
+
* `twrmc/camera-calibration` format unusable for anything but the application it came from.
|
|
8
|
+
*
|
|
9
|
+
* Camera Source owns the contract but never produces a profile. Chessboard calibration, an operator
|
|
10
|
+
* supplying JSON, or a future calibrator are all just producers of a document that passes validation.
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/calibration/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|