(p: Vec2, i: CameraIntrinsics)
| 82 | |
| 83 | const perspectiveRadialStrategy: DistortionStrategy = { |
| 84 | forward(p: Vec2, i: CameraIntrinsics): Vec2 { |
| 85 | const { x, y } = p; |
| 86 | const r2 = x * x + y * y; |
| 87 | const R = _prFactor(r2, i); |
| 88 | // Tangential terms vanish exactly when p1=p2=0 (SIMPLE_RADIAL, RADIAL). |
| 89 | const dx = x * R + 2 * i.p1 * x * y + i.p2 * (r2 + 2 * x * x); |
| 90 | const dy = y * R + i.p1 * (r2 + 2 * y * y) + 2 * i.p2 * x * y; |
| 91 | return { x: x + dx, y: y + dy }; |
| 92 | }, |
| 93 | |
| 94 | inverse(p: Vec2, i: CameraIntrinsics): UndistortResult { |
| 95 | let x = p.x; |
nothing calls this directly
no test coverage detected