@kubohiroya/turbowarp-camera-calibration 0.3.0 → 0.6.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 +9 -14
- package/README.md +42 -17
- package/dist/camera-calibration.js +329 -74
- package/dist/extension-manifest.json +34 -0
- package/docs/architecture.ja.md +12 -7
- package/docs/architecture.md +13 -8
- package/docs/index.html +0 -4
- package/lib/calibration/contract.d.ts +1 -1
- package/lib/calibration/types.d.ts +54 -2
- package/lib/runtime-capability.d.ts +22 -0
- package/lib/runtime-capability.js +3 -0
- package/package.json +2 -2
- package/src/block-definitions.json +134 -42
- package/src/calibration/contract.ts +1 -0
- package/src/calibration/controller.ts +119 -4
- package/src/calibration/opencv-backend.ts +252 -59
- package/src/calibration/pose.ts +117 -0
- package/src/calibration/types.ts +59 -2
- package/src/extension.ts +30 -43
- package/src/runtime-capability.ts +25 -0
package/README.ja.md
CHANGED
|
@@ -73,20 +73,15 @@ flagが止めるのは実行であってバイト数ではないためです。
|
|
|
73
73
|
校正の確認は、solveに使っていない別の画像で行ってください。採用サンプルに対する
|
|
74
74
|
再投影誤差が小さいことは、その結果が一般に通用することの証明にはなりません。
|
|
75
75
|
|
|
76
|
-
##
|
|
76
|
+
## solverが読み込まれるタイミング
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
常に`idle`を返します。カメラのleaseは取得せず、OpenCVのruntimeも初期化しません。
|
|
78
|
+
機能拡張を登録した時点で全ブロックがパレットに出ており、runtime capabilityも
|
|
79
|
+
runtimeに載っています。別途有効化する操作はありません。
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
flagは一度だけ読み取って凍結します。あとから値を変えても影響しません。実行中の
|
|
89
|
-
projectが途中で契約を切り替えることを防ぐためです。
|
|
81
|
+
OpenCVのruntimeは機能拡張と一緒には読み込まれません。最初のサンプル取得か
|
|
82
|
+
solveで初めて生成されるので、`camera calibration state`や
|
|
83
|
+
`camera calibration backend`を読むだけのprojectには一切の負荷がかかりません。
|
|
84
|
+
カメラのleaseも、校正を開始するまで取得しません。
|
|
90
85
|
|
|
91
86
|
## インストール
|
|
92
87
|
|
|
@@ -106,7 +101,7 @@ bundleは約11 MBあります。
|
|
|
106
101
|
検証済みのversionをexact pinします。
|
|
107
102
|
|
|
108
103
|
```bash
|
|
109
|
-
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.
|
|
104
|
+
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.6.0
|
|
110
105
|
```
|
|
111
106
|
|
|
112
107
|
standalone bundle:
|
|
@@ -118,7 +113,7 @@ node_modules/@kubohiroya/turbowarp-camera-calibration/dist/camera-calibration.js
|
|
|
118
113
|
version固定CDN URL:
|
|
119
114
|
|
|
120
115
|
```text
|
|
121
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.
|
|
116
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.6.0/dist/camera-calibration.js
|
|
122
117
|
```
|
|
123
118
|
|
|
124
119
|
## クイックスタート
|
package/README.md
CHANGED
|
@@ -74,21 +74,15 @@ Verify a finished calibration against images that were not part of the solve. A
|
|
|
74
74
|
low reprojection error on the calibration samples alone does not prove the
|
|
75
75
|
result generalizes.
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## When the solver loads
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`camera calibration state` reporter is published and it answers `idle`; no
|
|
82
|
-
camera lease is taken and the OpenCV runtime is never initialized.
|
|
79
|
+
Every block is in the palette as soon as the extension is registered, and the
|
|
80
|
+
runtime capability is on the runtime. Nothing is switched on separately.
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
The flags are read once and frozen. Changing the value afterwards has no effect,
|
|
91
|
-
which keeps a running project from switching contracts mid-session.
|
|
82
|
+
The OpenCV runtime is not loaded with the extension. It is created on the first
|
|
83
|
+
sample or solve and never before, so a project that only reads
|
|
84
|
+
`camera calibration state` or `camera calibration backend` pays nothing for it.
|
|
85
|
+
No camera lease is taken until a calibration starts.
|
|
92
86
|
|
|
93
87
|
## Installation
|
|
94
88
|
|
|
@@ -108,7 +102,7 @@ therefore about 11 MB.
|
|
|
108
102
|
Install an exact version that you have reviewed:
|
|
109
103
|
|
|
110
104
|
```bash
|
|
111
|
-
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.
|
|
105
|
+
pnpm add --save-exact @kubohiroya/turbowarp-camera-calibration@0.6.0
|
|
112
106
|
```
|
|
113
107
|
|
|
114
108
|
Load the standalone bundle from:
|
|
@@ -120,7 +114,7 @@ node_modules/@kubohiroya/turbowarp-camera-calibration/dist/camera-calibration.js
|
|
|
120
114
|
A version-pinned CDN URL is:
|
|
121
115
|
|
|
122
116
|
```text
|
|
123
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.
|
|
117
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-camera-calibration@0.6.0/dist/camera-calibration.js
|
|
124
118
|
```
|
|
125
119
|
|
|
126
120
|
## Quick start
|
|
@@ -188,9 +182,9 @@ generated section manually.
|
|
|
188
182
|
|
|
189
183
|
<!-- BEGIN GENERATED BLOCKS -->
|
|
190
184
|
|
|
191
|
-
### `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`
|
|
192
186
|
|
|
193
|
-
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.
|
|
194
188
|
|
|
195
189
|
| Property | Value |
|
|
196
190
|
|---|---|
|
|
@@ -201,6 +195,7 @@ Leases one shared Camera Source camera and fixes its real capture resolution for
|
|
|
201
195
|
| `COLUMNS` | Number, default: `9` |
|
|
202
196
|
| `ROWS` | Number, default: `6` |
|
|
203
197
|
| `SQUARE_METERS` | Number, default: `0.025` |
|
|
198
|
+
| `MARKER_METERS` | Number, default: `0.018` |
|
|
204
199
|
| `MAX_ERROR_PX` | Number, default: `1.5` |
|
|
205
200
|
|
|
206
201
|
### `add calibration sample for camera [CAMERA_ID]`
|
|
@@ -334,6 +329,36 @@ Returns the RMS reprojection error in pixels for the latest solve or imported pr
|
|
|
334
329
|
| Opcode | `cameraCalibrationReprojectionError` |
|
|
335
330
|
| `CAMERA_ID` | String, default: `default` |
|
|
336
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
|
+
|
|
337
362
|
### `camera [CAMERA_ID] calibration error code`
|
|
338
363
|
|
|
339
364
|
Returns a stable code for dependency, board, camera, sample, solve, reprojection, profile, or publication errors, or an empty string.
|