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

Function _prDeriv

src/utils/cameraUndistortion.ts:73–81  ·  view source on GitHub ↗
(r2: number, i: CameraIntrinsics)

Source from the content-addressed store, hash-verified

71}
72
73function _prDeriv(r2: number, i: CameraIntrinsics): number {
74 const r4 = r2 * r2;
75 const r6 = r4 * r2;
76 const num = 1 + i.k1 * r2 + i.k2 * r4 + i.k3 * r6;
77 const den = 1 + i.k4 * r2 + i.k5 * r4 + i.k6 * r6;
78 const numP = i.k1 + 2 * i.k2 * r2 + 3 * i.k3 * r4;
79 const denP = i.k4 + 2 * i.k5 * r2 + 3 * i.k6 * r4;
80 return (numP * den - num * denP) / (den * den);
81}
82
83const perspectiveRadialStrategy: DistortionStrategy = {
84 forward(p: Vec2, i: CameraIntrinsics): Vec2 {

Callers 1

inverseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected