@kubohiroya/turbowarp-camera-calibration 0.4.0 → 0.7.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 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.4.0
104
+ pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.7.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.4.0/dist/camera-calibration.js
116
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.7.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.4.0
105
+ pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.7.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.4.0/dist/camera-calibration.js
117
+ https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.7.0/dist/camera-calibration.js
118
118
  ```
119
119
 
120
120
  ## Quick start
@@ -182,9 +182,9 @@ generated section manually.
182
182
 
183
183
  <!-- BEGIN GENERATED BLOCKS -->
184
184
 
185
- ### `start camera [CAMERA_ID] calibration [CALIBRATION_ID] board [COLUMNS] by [ROWS] square [SQUARE_METERS] m max error [MAX_ERROR_PX] px`
185
+ ### `start camera [CAMERA_ID] calibration [CALIBRATION_ID] board [COLUMNS] by [ROWS] square [SQUARE_METERS] m marker [MARKER_METERS] m max error [MAX_ERROR_PX] px`
186
186
 
187
- Leases one shared Camera Source camera and fixes its real capture resolution for a chessboard calibration session. The board is measured in inner corners, not printed squares.
187
+ Leases one shared Camera Source camera and fixes its real capture resolution for a chessboard calibration session. The board is a ChArUco target: a chessboard with an ArUco marker inside each light square, so a view that runs off the frame still contributes the corners it shows. The board is measured in inner corners, not printed squares.
188
188
 
189
189
  | Property | Value |
190
190
  |---|---|
@@ -195,6 +195,7 @@ Leases one shared Camera Source camera and fixes its real capture resolution for
195
195
  | `COLUMNS` | Number, default: `9` |
196
196
  | `ROWS` | Number, default: `6` |
197
197
  | `SQUARE_METERS` | Number, default: `0.025` |
198
+ | `MARKER_METERS` | Number, default: `0.018` |
198
199
  | `MAX_ERROR_PX` | Number, default: `1.5` |
199
200
 
200
201
  ### `add calibration sample for camera [CAMERA_ID]`
@@ -328,6 +329,36 @@ Returns the RMS reprojection error in pixels for the latest solve or imported pr
328
329
  | Opcode | `cameraCalibrationReprojectionError` |
329
330
  | `CAMERA_ID` | String, default: `default` |
330
331
 
332
+ ### `camera [CAMERA_ID] calibration pose spread`
333
+
334
+ Returns how varied the angles of the collected samples are. Zero means every sample was taken from the same direction, which cannot be solved from: focal length and distance stay inseparable. Solving is refused below the required spread.
335
+
336
+ | Property | Value |
337
+ |---|---|
338
+ | Type | Reporter |
339
+ | Opcode | `cameraCalibrationPoseSpread` |
340
+ | `CAMERA_ID` | String, default: `default` |
341
+
342
+ ### `camera [CAMERA_ID] calibration holdout error px`
343
+
344
+ Returns the RMS reprojection error over the samples the solve was not fitted to. Compare it with the reprojection error: the two agreeing is the evidence that the calibration generalizes, and the two disagreeing says the set was too small or too alike.
345
+
346
+ | Property | Value |
347
+ |---|---|
348
+ | Type | Reporter |
349
+ | Opcode | `cameraCalibrationHoldoutErrorPx` |
350
+ | `CAMERA_ID` | String, default: `default` |
351
+
352
+ ### `camera [CAMERA_ID] calibration holdout sample count`
353
+
354
+ Returns how many samples were held back from the solve. Zero means nothing was validated, so the holdout error says nothing.
355
+
356
+ | Property | Value |
357
+ |---|---|
358
+ | Type | Reporter |
359
+ | Opcode | `cameraCalibrationHoldoutSampleCount` |
360
+ | `CAMERA_ID` | String, default: `default` |
361
+
331
362
  ### `camera [CAMERA_ID] calibration error code`
332
363
 
333
364
  Returns a stable code for dependency, board, camera, sample, solve, reprojection, profile, or publication errors, or an empty string.
@@ -5,23 +5,29 @@ including the components listed below.
5
5
 
6
6
  ## OpenCV.js
7
7
 
8
- The chessboard detector and the `calibrateCamera` solver come from OpenCV.js, bundled through
9
- [`@techstark/opencv-js`](https://github.com/TechStark/opencv-js) at the exact version
10
- `4.12.0-release.1`. The version is pinned in `package.json` and is part of the backend identifier
11
- that the `camera calibration backend` block reports, so a project can record which build produced a
12
- profile.
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 build is about 10.4 MB, which is why the calibration procedure lives in this extension rather
21
- than in `@kubohiroya/turbowarp-camera-source`. A TurboWarp extension ships as one standalone file,
22
- so a dynamic `import()` is inlined into the same file instead of being split into a separate chunk.
23
- The import is still lazy at run time: the WebAssembly runtime is initialized on the first sample or
24
- solve, and never when the extension loads or when the backend reporter is read.
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