(modelId: CameraModelId, intrins: CameraIntrinsics, pts: Vec2[])
| 26 | } |
| 27 | |
| 28 | function maxRoundTripError(modelId: CameraModelId, intrins: CameraIntrinsics, pts: Vec2[]): number { |
| 29 | let max = 0; |
| 30 | for (const u of pts) { |
| 31 | const d = distortNormalized(u, intrins, modelId); |
| 32 | const back = undistortNormalized(d, intrins, modelId); |
| 33 | expect(back.valid).toBe(true); |
| 34 | max = Math.max(max, Math.hypot(back.x - u.x, back.y - u.y)); |
| 35 | } |
| 36 | return max; |
| 37 | } |
| 38 | |
| 39 | describe('perspective forward distortion', () => { |
| 40 | it('PINHOLE is identity', () => { |
no test coverage detected