MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / maxRoundTripError

Function maxRoundTripError

src/utils/cameraUndistortion.test.ts:28–37  ·  view source on GitHub ↗
(modelId: CameraModelId, intrins: CameraIntrinsics, pts: Vec2[])

Source from the content-addressed store, hash-verified

26}
27
28function 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
39describe('perspective forward distortion', () => {
40 it('PINHOLE is identity', () => {

Callers 1

Calls 2

distortNormalizedFunction · 0.90
undistortNormalizedFunction · 0.90

Tested by

no test coverage detected