@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,346 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kubohiroya.github.io/turbowarp-camera-source/schema/camera-intrinsics-v1.json",
|
|
4
|
+
"title": "Camera intrinsic calibration profile v1",
|
|
5
|
+
"description": "How one camera projects the world onto its own captured image. Carries no world pose: where a camera stands is solved separately against a shared reference, and mixing the two lets a stale extrinsic be read as a current placement.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema",
|
|
10
|
+
"version",
|
|
11
|
+
"profileId",
|
|
12
|
+
"cameraId",
|
|
13
|
+
"calibratedAt",
|
|
14
|
+
"producer",
|
|
15
|
+
"cameraModel",
|
|
16
|
+
"image",
|
|
17
|
+
"intrinsics",
|
|
18
|
+
"distortion"
|
|
19
|
+
],
|
|
20
|
+
"properties": {
|
|
21
|
+
"schema": {
|
|
22
|
+
"const": "twcs/camera-intrinsics"
|
|
23
|
+
},
|
|
24
|
+
"version": {
|
|
25
|
+
"const": 1
|
|
26
|
+
},
|
|
27
|
+
"profileId": {
|
|
28
|
+
"$ref": "#/$defs/identifier",
|
|
29
|
+
"description": "Identifies this calibration run. A new solve produces a new id."
|
|
30
|
+
},
|
|
31
|
+
"cameraId": {
|
|
32
|
+
"$ref": "#/$defs/identifier",
|
|
33
|
+
"description": "Operator-assigned camera name such as stage-left. Stable across calibration runs."
|
|
34
|
+
},
|
|
35
|
+
"calibratedAt": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,6})?Z$",
|
|
38
|
+
"description": "When the calibration was solved, as an RFC 3339 timestamp in UTC."
|
|
39
|
+
},
|
|
40
|
+
"producer": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1,
|
|
43
|
+
"maxLength": 256,
|
|
44
|
+
"description": "Free text naming whatever produced the profile. Diagnostics only; the contract does not care which extension, tool or person it was."
|
|
45
|
+
},
|
|
46
|
+
"cameraModel": {
|
|
47
|
+
"const": "pinhole"
|
|
48
|
+
},
|
|
49
|
+
"image": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"required": [
|
|
53
|
+
"width",
|
|
54
|
+
"height",
|
|
55
|
+
"undistorted"
|
|
56
|
+
],
|
|
57
|
+
"description": "The image the calibration was solved against. Always the camera's own capture; preview mirroring is a display choice and never changes the calibration.",
|
|
58
|
+
"properties": {
|
|
59
|
+
"width": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 1,
|
|
62
|
+
"maximum": 16384
|
|
63
|
+
},
|
|
64
|
+
"height": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 1,
|
|
67
|
+
"maximum": 16384
|
|
68
|
+
},
|
|
69
|
+
"undistorted": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"description": "False for the base contract: the profile describes the raw frame and the consumer applies the distortion model. True states that the images are already corrected, which then forbids leftover coefficients."
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"intrinsics": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"required": [
|
|
79
|
+
"fx",
|
|
80
|
+
"fy",
|
|
81
|
+
"cx",
|
|
82
|
+
"cy",
|
|
83
|
+
"skew"
|
|
84
|
+
],
|
|
85
|
+
"description": "Pinhole parameters in pixels of the calibration image, with x to the right and y downward from the top-left corner. Named rather than packed into an array because nine numbers cannot say whether they are row-major or column-major. The equivalent row-major 3x3 matrix is [fx, skew, cx, 0, fy, cy, 0, 0, 1].",
|
|
86
|
+
"properties": {
|
|
87
|
+
"fx": {
|
|
88
|
+
"type": "number",
|
|
89
|
+
"exclusiveMinimum": 0,
|
|
90
|
+
"maximum": 10000000
|
|
91
|
+
},
|
|
92
|
+
"fy": {
|
|
93
|
+
"type": "number",
|
|
94
|
+
"exclusiveMinimum": 0,
|
|
95
|
+
"maximum": 10000000
|
|
96
|
+
},
|
|
97
|
+
"cx": {
|
|
98
|
+
"type": "number",
|
|
99
|
+
"minimum": -10000000,
|
|
100
|
+
"maximum": 10000000
|
|
101
|
+
},
|
|
102
|
+
"cy": {
|
|
103
|
+
"type": "number",
|
|
104
|
+
"minimum": -10000000,
|
|
105
|
+
"maximum": 10000000
|
|
106
|
+
},
|
|
107
|
+
"skew": {
|
|
108
|
+
"type": "number",
|
|
109
|
+
"minimum": -10000000,
|
|
110
|
+
"maximum": 10000000,
|
|
111
|
+
"description": "Axis skew. Zero for every square-pixel sensor; kept explicit so it is never assumed."
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"distortion": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"additionalProperties": false,
|
|
118
|
+
"required": [
|
|
119
|
+
"model",
|
|
120
|
+
"coefficients"
|
|
121
|
+
],
|
|
122
|
+
"properties": {
|
|
123
|
+
"model": {
|
|
124
|
+
"enum": [
|
|
125
|
+
"none",
|
|
126
|
+
"brown-conrady",
|
|
127
|
+
"kannala-brandt"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"coefficients": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": {
|
|
133
|
+
"type": "number",
|
|
134
|
+
"minimum": -10000,
|
|
135
|
+
"maximum": 10000
|
|
136
|
+
},
|
|
137
|
+
"description": "Brown-Conrady carries the OpenCV coefficients in their usual order: k1, k2, p1, p2, optionally k3, and k4 to k6 for the rational model. Kannala-Brandt carries the four fisheye coefficients."
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"allOf": [
|
|
141
|
+
{
|
|
142
|
+
"if": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"required": [
|
|
145
|
+
"model"
|
|
146
|
+
],
|
|
147
|
+
"properties": {
|
|
148
|
+
"model": {
|
|
149
|
+
"const": "none"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"then": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"coefficients": {
|
|
157
|
+
"type": "array",
|
|
158
|
+
"maxItems": 0
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"if": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"required": [
|
|
167
|
+
"model"
|
|
168
|
+
],
|
|
169
|
+
"properties": {
|
|
170
|
+
"model": {
|
|
171
|
+
"const": "brown-conrady"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"then": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"properties": {
|
|
178
|
+
"coefficients": {
|
|
179
|
+
"type": "array",
|
|
180
|
+
"anyOf": [
|
|
181
|
+
{
|
|
182
|
+
"minItems": 4,
|
|
183
|
+
"maxItems": 4
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"minItems": 5,
|
|
187
|
+
"maxItems": 5
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
"minItems": 8,
|
|
191
|
+
"maxItems": 8
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"if": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"required": [
|
|
202
|
+
"model"
|
|
203
|
+
],
|
|
204
|
+
"properties": {
|
|
205
|
+
"model": {
|
|
206
|
+
"const": "kannala-brandt"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
"then": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {
|
|
213
|
+
"coefficients": {
|
|
214
|
+
"type": "array",
|
|
215
|
+
"minItems": 4,
|
|
216
|
+
"maxItems": 4
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"capture": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"additionalProperties": false,
|
|
226
|
+
"description": "The capture configuration the calibration was solved under. Optional as a whole, and optional member by member, but the difference matters: an absent block means nothing was recorded and compatibility cannot be decided, while an absent member inside a present block means the device reported no such control at calibration time. frameRate and facingMode are recorded for the operator and do not decide compatibility, because neither changes how the lens projects.",
|
|
227
|
+
"properties": {
|
|
228
|
+
"frameRate": {
|
|
229
|
+
"type": "number",
|
|
230
|
+
"exclusiveMinimum": 0,
|
|
231
|
+
"maximum": 1000
|
|
232
|
+
},
|
|
233
|
+
"facingMode": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"minLength": 1,
|
|
236
|
+
"maxLength": 256
|
|
237
|
+
},
|
|
238
|
+
"resizeMode": {
|
|
239
|
+
"enum": [
|
|
240
|
+
"none",
|
|
241
|
+
"crop-and-scale"
|
|
242
|
+
],
|
|
243
|
+
"description": "Cropping changes the effective intrinsics at the same resolution."
|
|
244
|
+
},
|
|
245
|
+
"zoom": {
|
|
246
|
+
"type": "number",
|
|
247
|
+
"exclusiveMinimum": 0,
|
|
248
|
+
"maximum": 1000
|
|
249
|
+
},
|
|
250
|
+
"focusMode": {
|
|
251
|
+
"enum": [
|
|
252
|
+
"none",
|
|
253
|
+
"manual",
|
|
254
|
+
"single-shot",
|
|
255
|
+
"continuous"
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
"focusDistance": {
|
|
259
|
+
"type": "number",
|
|
260
|
+
"minimum": 0,
|
|
261
|
+
"maximum": 10000
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"quality": {
|
|
266
|
+
"type": "object",
|
|
267
|
+
"additionalProperties": false,
|
|
268
|
+
"required": [
|
|
269
|
+
"sampleCount",
|
|
270
|
+
"reprojectionErrorPx"
|
|
271
|
+
],
|
|
272
|
+
"description": "Optional. Absent means the producer did not report quality, which is not the same as a measured zero.",
|
|
273
|
+
"properties": {
|
|
274
|
+
"sampleCount": {
|
|
275
|
+
"type": "integer",
|
|
276
|
+
"minimum": 1,
|
|
277
|
+
"maximum": 10000
|
|
278
|
+
},
|
|
279
|
+
"reprojectionErrorPx": {
|
|
280
|
+
"type": "number",
|
|
281
|
+
"minimum": 0,
|
|
282
|
+
"maximum": 10000
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"device": {
|
|
287
|
+
"type": "object",
|
|
288
|
+
"additionalProperties": false,
|
|
289
|
+
"description": "Hints for recognizing the physical camera again. deviceId is a hint and not an identity: browsers scope it per origin and per profile, so it changes without the camera changing.",
|
|
290
|
+
"properties": {
|
|
291
|
+
"label": {
|
|
292
|
+
"type": "string",
|
|
293
|
+
"minLength": 1,
|
|
294
|
+
"maxLength": 256
|
|
295
|
+
},
|
|
296
|
+
"deviceId": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"minLength": 1,
|
|
299
|
+
"maxLength": 256
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
"allOf": [
|
|
305
|
+
{
|
|
306
|
+
"if": {
|
|
307
|
+
"type": "object",
|
|
308
|
+
"required": [
|
|
309
|
+
"image"
|
|
310
|
+
],
|
|
311
|
+
"properties": {
|
|
312
|
+
"image": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"required": [
|
|
315
|
+
"undistorted"
|
|
316
|
+
],
|
|
317
|
+
"properties": {
|
|
318
|
+
"undistorted": {
|
|
319
|
+
"const": true
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"then": {
|
|
326
|
+
"type": "object",
|
|
327
|
+
"properties": {
|
|
328
|
+
"distortion": {
|
|
329
|
+
"type": "object",
|
|
330
|
+
"properties": {
|
|
331
|
+
"model": {
|
|
332
|
+
"const": "none"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
"$defs": {
|
|
341
|
+
"identifier": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/kubohiroya/turbowarp-extension-template/main/schemas/extension-manifest.schema.json",
|
|
4
|
+
"title": "TurboWarp Extension API Manifest",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["formatVersion", "id", "blocks", "menus"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"formatVersion": {"const": 1},
|
|
10
|
+
"id": {"type": "string", "pattern": "^[a-z0-9]+$"},
|
|
11
|
+
"blocks": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["opcode", "blockType", "arguments"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"opcode": {"type": "string", "minLength": 1},
|
|
19
|
+
"blockType": {"type": "string", "minLength": 1},
|
|
20
|
+
"arguments": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["id", "type"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"id": {"type": "string", "minLength": 1},
|
|
28
|
+
"type": {"type": "string", "minLength": 1},
|
|
29
|
+
"menu": {"type": "string", "minLength": 1}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"menus": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["id", "acceptReporters"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"id": {"type": "string", "minLength": 1},
|
|
44
|
+
"acceptReporters": {"type": "boolean"}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|