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

Function projectPoint

src/utils/cameraModelProjection.ts:72–80  ·  view source on GitHub ↗

* Project undistorted pinhole-normalised coordinates (X/Z, Y/Z) to pixel * coordinates by delegating distortion application to the canonical * `distortNormalized` from `cameraUndistortion.ts`.

(
  camera: Camera,
  nx: number,
  ny: number
)

Source from the content-addressed store, hash-verified

70 * `distortNormalized` from `cameraUndistortion.ts`.
71 */
72function projectPoint(
73 camera: Camera,
74 nx: number,
75 ny: number
76): { x: number; y: number } | null {
77 const i = getCameraIntrinsics(camera);
78 const d = distortNormalized({ x: nx, y: ny }, i, camera.modelId);
79 return { x: d.x * i.fx + i.cx, y: d.y * i.fy + i.cy };
80}

Calls 2

getCameraIntrinsicsFunction · 0.90
distortNormalizedFunction · 0.90

Tested by

no test coverage detected