@kubohiroya/turbowarp-camera-calibration 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 +2 -2
- package/README.md +67 -2
- package/THIRD_PARTY_NOTICES.md +17 -11
- package/dist/camera-calibration.js +785 -7642
- package/dist/extension-manifest.json +80 -0
- package/lib/calibration/contract.d.ts +53 -1
- package/lib/calibration/types.d.ts +50 -1
- package/lib/runtime-capability.d.ts +37 -2
- package/lib/runtime-capability.js +14 -3
- package/lib/runtime.d.ts +1 -1
- package/package.json +6 -3
- package/src/block-definitions.json +92 -0
- package/src/calibration/contract.ts +57 -0
- package/src/calibration/controller.ts +405 -22
- package/src/calibration/opencv-backend.ts +135 -69
- package/src/calibration/opencv-symbols.ts +65 -0
- package/src/calibration/opencv-worker.ts +40 -0
- package/src/calibration/types.ts +52 -1
- package/src/calibration/worker-backend.ts +122 -0
- package/src/extension.ts +64 -2
- package/src/globals.d.ts +16 -0
- package/src/runtime-capability.ts +52 -3
- package/src/runtime.ts +1 -0
- package/vendor/opencv.js +49 -0
package/README.ja.md
CHANGED
|
@@ -101,7 +101,7 @@ bundleは約11 MBあります。
|
|
|
101
101
|
検証済みのversionをexact pinします。
|
|
102
102
|
|
|
103
103
|
```bash
|
|
104
|
-
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.
|
|
104
|
+
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.8.0
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
standalone bundle:
|
|
@@ -113,7 +113,7 @@ node_modules/@kubohiroya/turbowarp-camera-calibration/dist/camera-calibration.js
|
|
|
113
113
|
version固定CDN URL:
|
|
114
114
|
|
|
115
115
|
```text
|
|
116
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.
|
|
116
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.8.0/dist/camera-calibration.js
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
## クイックスタート
|
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ therefore about 11 MB.
|
|
|
102
102
|
Install an exact version that you have reviewed:
|
|
103
103
|
|
|
104
104
|
```bash
|
|
105
|
-
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.
|
|
105
|
+
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.8.0
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
Load the standalone bundle from:
|
|
@@ -114,7 +114,7 @@ node_modules/@kubohiroya/turbowarp-camera-calibration/dist/camera-calibration.js
|
|
|
114
114
|
A version-pinned CDN URL is:
|
|
115
115
|
|
|
116
116
|
```text
|
|
117
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.
|
|
117
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.8.0/dist/camera-calibration.js
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
## Quick start
|
|
@@ -208,6 +208,46 @@ Detects the complete board in the current shared frame and retains it when its q
|
|
|
208
208
|
| Opcode | `addCameraCalibrationSample` |
|
|
209
209
|
| `CAMERA_ID` | String, default: `default` |
|
|
210
210
|
|
|
211
|
+
### `start automatic calibration capture for camera [CAMERA_ID]`
|
|
212
|
+
|
|
213
|
+
Watches the shared frame and retains views as the board reaches positions worth retaining, re-solving in the background as the set grows and finishing the session once the answer reproduces views it was not fitted to. Use after starting a session; a frame that cannot be used leaves guidance rather than an error.
|
|
214
|
+
|
|
215
|
+
| Property | Value |
|
|
216
|
+
|---|---|
|
|
217
|
+
| Type | Command |
|
|
218
|
+
| Opcode | `startAutomaticCameraCalibration` |
|
|
219
|
+
| `CAMERA_ID` | String, default: `default` |
|
|
220
|
+
|
|
221
|
+
### `stop automatic calibration capture for camera [CAMERA_ID]`
|
|
222
|
+
|
|
223
|
+
Hands the shutter back. The session stays open with everything collected so far, so sampling and solving can continue by hand.
|
|
224
|
+
|
|
225
|
+
| Property | Value |
|
|
226
|
+
|---|---|
|
|
227
|
+
| Type | Command |
|
|
228
|
+
| Opcode | `stopAutomaticCameraCalibration` |
|
|
229
|
+
| `CAMERA_ID` | String, default: `default` |
|
|
230
|
+
|
|
231
|
+
### `automatic capture running for camera [CAMERA_ID]?`
|
|
232
|
+
|
|
233
|
+
Reports whether the shutter is watching that camera on its own. It stops by itself when the session finishes, when the sample limit is reached, and when the camera goes away.
|
|
234
|
+
|
|
235
|
+
| Property | Value |
|
|
236
|
+
|---|---|
|
|
237
|
+
| Type | Boolean |
|
|
238
|
+
| Opcode | `automaticCameraCalibration` |
|
|
239
|
+
| `CAMERA_ID` | String, default: `default` |
|
|
240
|
+
|
|
241
|
+
### `camera calibration guidance [CAMERA_ID]`
|
|
242
|
+
|
|
243
|
+
Returns what the operator should do next while automatic capture runs: show-the-board, hold-steadier, move-or-tilt, tilt-more, keep-going, solving, limit-reached, or complete. Empty when the shutter is not watching. This is not an error: most frames are declined, because most of the time the board is between two useful positions.
|
|
244
|
+
|
|
245
|
+
| Property | Value |
|
|
246
|
+
|---|---|
|
|
247
|
+
| Type | Reporter |
|
|
248
|
+
| Opcode | `cameraCalibrationGuidance` |
|
|
249
|
+
| `CAMERA_ID` | String, default: `default` |
|
|
250
|
+
|
|
211
251
|
### `solve calibration for camera [CAMERA_ID]`
|
|
212
252
|
|
|
213
253
|
Solves the intrinsic matrix and distortion coefficients from at least eight accepted samples, then releases the camera lease. No external pose is produced.
|
|
@@ -248,6 +288,21 @@ Registers the solved profile with Camera Source, which owns the profile contract
|
|
|
248
288
|
| Opcode | `publishCameraCalibration` |
|
|
249
289
|
| `CAMERA_ID` | String, default: `default` |
|
|
250
290
|
|
|
291
|
+
### `measure camera [CAMERA_ID] board pose board [COLUMNS] by [ROWS] square [SQUARE_METERS] m marker [MARKER_METERS] m scale [SCALE_SOURCE]`
|
|
292
|
+
|
|
293
|
+
Measures where the board is, in the camera's own frame, using the calibration already solved for that camera. Take it after the board is where it will stay: a calibration needs the board to move, so while one is being collected there is no single position to report. This is not a world pose. Scale comes entirely from the square size, so say whether that was measured or nominal.
|
|
294
|
+
|
|
295
|
+
| Property | Value |
|
|
296
|
+
|---|---|
|
|
297
|
+
| Type | Command |
|
|
298
|
+
| Opcode | `measureCameraBoardPose` |
|
|
299
|
+
| `CAMERA_ID` | String, default: `default` |
|
|
300
|
+
| `COLUMNS` | Number, default: `9` |
|
|
301
|
+
| `ROWS` | Number, default: `6` |
|
|
302
|
+
| `SQUARE_METERS` | Number, default: `0.025` |
|
|
303
|
+
| `MARKER_METERS` | Number, default: `0.018` |
|
|
304
|
+
| `SCALE_SOURCE` | String, default: `nominal` |
|
|
305
|
+
|
|
251
306
|
### `import calibration profile [JSON] for camera [CAMERA_ID]`
|
|
252
307
|
|
|
253
308
|
Imports a calibration profile after schema, credential, and applicability checks. Pre-migration profiles are accepted and their world pose is dropped rather than reinterpreted.
|
|
@@ -389,6 +444,16 @@ Exports the stored intrinsic profile for that camera, or an empty string when no
|
|
|
389
444
|
| Opcode | `cameraCalibrationJson` |
|
|
390
445
|
| `CAMERA_ID` | String, default: `default` |
|
|
391
446
|
|
|
447
|
+
### `camera [CAMERA_ID] board pose JSON`
|
|
448
|
+
|
|
449
|
+
Returns the last measured board pose as JSON, or an empty string when none was measured. The pose is the board in the camera's frame, never a world pose, and it carries the observed corners and whether its scale was measured or nominal so it can be re-solved elsewhere.
|
|
450
|
+
|
|
451
|
+
| Property | Value |
|
|
452
|
+
|---|---|
|
|
453
|
+
| Type | Reporter |
|
|
454
|
+
| Opcode | `cameraBoardPoseJson` |
|
|
455
|
+
| `CAMERA_ID` | String, default: `default` |
|
|
456
|
+
|
|
392
457
|
<!-- END GENERATED BLOCKS -->
|
|
393
458
|
|
|
394
459
|
## Important behavior
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -5,23 +5,29 @@ including the components listed below.
|
|
|
5
5
|
|
|
6
6
|
## OpenCV.js
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
[
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
`vendor/opencv.js` is built from [OpenCV](https://github.com/opencv/opencv) at tag `4.12.0`
|
|
9
|
+
by [`tools/opencv/build.sh`](tools/opencv/build.sh), in a pinned Emscripten container. It is not a
|
|
10
|
+
published npm package: the stock `@techstark/opencv-js` build never finishes initializing inside a
|
|
11
|
+
Web Worker, which is where the solver has to run, and it is 10.9 MB of general-purpose OpenCV for
|
|
12
|
+
the twenty-three symbols this extension calls. Ours is 3.85 MB and starts in a worker in 18 ms.
|
|
13
|
+
|
|
14
|
+
The build drops OpenCV's unconditional `-s DEMANGLE_SUPPORT=1`, a setting Emscripten has removed;
|
|
15
|
+
it only added demangled names to stack traces. Nothing else in OpenCV's sources is modified.
|
|
13
16
|
|
|
14
17
|
OpenCV is distributed under the Apache License 2.0:
|
|
15
18
|
|
|
16
19
|
- <https://github.com/opencv/opencv>
|
|
17
|
-
- <https://github.com/TechStark/opencv-js>
|
|
18
20
|
- <https://www.apache.org/licenses/LICENSE-2.0>
|
|
19
21
|
|
|
20
|
-
The
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
The WebAssembly is inlined into `dist/camera-calibration.js`, because a TurboWarp extension ships as
|
|
23
|
+
one standalone file and a separate `.wasm` would have nowhere to be fetched from. The runtime is
|
|
24
|
+
still initialized lazily: the worker is not created until a calibration starts, so loading the
|
|
25
|
+
extension or reading the backend reporter never touches it.
|
|
26
|
+
|
|
27
|
+
## Comlink
|
|
28
|
+
|
|
29
|
+
The worker is addressed through [Comlink](https://github.com/GoogleChromeLabs/comlink) at the exact
|
|
30
|
+
version `4.4.2`, distributed under the Apache License 2.0.
|
|
25
31
|
|
|
26
32
|
## Camera Source declarations
|
|
27
33
|
|