@gyeonghokim/fisheye.js 0.0.0 → 1.0.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.md +11 -11
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# fisheye.js
|
|
2
2
|
|
|
3
|
-
> Modern fisheye dewarping library for the web
|
|
3
|
+
> Modern fisheye dewarping library for the web using **WebGPU** (general-purpose GPU compute)
|
|
4
4
|
|
|
5
|
-
fisheye.js
|
|
5
|
+
fisheye.js processes [VideoFrame](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame)s with **WebGPU compute shaders**—no canvas 2D—and corrects fisheye lens distortion using the **OpenCV fisheye camera model** (polynomial in angle θ with coefficients k1–k4), not a simple radial model.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
9
|
+
- **WebGPU GPGPU**: Compute-shader pipeline via [TypeGPU](https://www.npmjs.com/package/typegpu); input/output as textures and readback to VideoFrame—no canvas element for dewarping
|
|
10
|
+
- **OpenCV fisheye model**: Distortion model `θ_d = θ × (1 + k1·θ² + k2·θ⁴ + k3·θ⁶ + k4·θ⁸)` for accurate calibration
|
|
11
|
+
- **WebCodecs**: Built on the [VideoFrame](https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame) API
|
|
12
|
+
- **ESM**: `import { Fisheye } from "@gyeonghokim/fisheye.js"`
|
|
13
|
+
- **npm**: Install via npm or other package managers
|
|
14
14
|
|
|
15
15
|
## Getting Started(Typescript Example)
|
|
16
16
|
|
|
@@ -68,12 +68,12 @@ Creates a new Fisheye dewarper instance.
|
|
|
68
68
|
|
|
69
69
|
**Options:**
|
|
70
70
|
|
|
71
|
-
- `k1` (number, optional): Fisheye distortion coefficient k1. Typical range: -1.0 to 1.0. Default: `0
|
|
71
|
+
- `k1` (number, optional): Fisheye distortion coefficient k1. Typical range: -1.0 to 1.0. Default: `0`.
|
|
72
72
|
- `k2` (number, optional): Fisheye distortion coefficient k2. Default: `0`.
|
|
73
73
|
- `k3` (number, optional): Fisheye distortion coefficient k3. Default: `0`.
|
|
74
74
|
- `k4` (number, optional): Fisheye distortion coefficient k4. Default: `0`.
|
|
75
|
-
- `width` (number, optional): Output
|
|
76
|
-
- `height` (number, optional): Output
|
|
75
|
+
- `width` (number, optional): Output frame width. Default: `300`
|
|
76
|
+
- `height` (number, optional): Output frame height. Default: `150`
|
|
77
77
|
- `fov` (number, optional): Field of view in degrees. Default: `180`
|
|
78
78
|
- `centerX` (number, optional): X offset of the lens center (normalized, -1.0 to 1.0). Default: `0`
|
|
79
79
|
- `centerY` (number, optional): Y offset of the lens center (normalized, -1.0 to 1.0). Default: `0`
|
|
@@ -114,7 +114,7 @@ If you receive raw YUV binary data from a camera or server, you can use the `cre
|
|
|
114
114
|
```ts
|
|
115
115
|
import { Fisheye, createVideoFrameFromYUV } from "@gyeonghokim/fisheye.js";
|
|
116
116
|
|
|
117
|
-
const dewarper = new Fisheye({
|
|
117
|
+
const dewarper = new Fisheye({ k1: 0.5, width: 1920, height: 1080 });
|
|
118
118
|
|
|
119
119
|
// Example: Receiving NV12 data from a server
|
|
120
120
|
const response = await fetch("/api/camera/frame");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gyeonghokim/fisheye.js",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"description": "Modern fisheye dewarping library for the web using WebGPU",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"registry": "https://registry.npmjs.org/",
|
|
53
53
|
"tag": "latest",
|
|
54
|
-
"access": "public"
|
|
54
|
+
"access": "public",
|
|
55
|
+
"provenance": true
|
|
55
56
|
},
|
|
56
57
|
"bugs": {
|
|
57
58
|
"url": "https://github.com/GyeongHoKim/fisheye.js/issues"
|
|
@@ -78,6 +79,6 @@
|
|
|
78
79
|
"vitest": "^4.0.18"
|
|
79
80
|
},
|
|
80
81
|
"engines": {
|
|
81
|
-
"node": ">=
|
|
82
|
+
"node": ">=24.0.0"
|
|
82
83
|
}
|
|
83
84
|
}
|