MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / assertIntegrity

Function assertIntegrity

src/parsers/integrity.test.ts:72–87  ·  view source on GitHub ↗

* The core integrity check pycolmap implicitly performs: for every points3D * track element (image_id, point2D_idx), the referenced image must exist and * have at least `point2D_idx + 1` entries in its points2D array.

(images: Map<number, Image>, points3D: Map<bigint, Point3D>)

Source from the content-addressed store, hash-verified

70 * have at least `point2D_idx + 1` entries in its points2D array.
71 */
72function assertIntegrity(images: Map<number, Image>, points3D: Map<bigint, Point3D>): void {
73 for (const [pointId, point] of points3D) {
74 for (const elem of point.track) {
75 const img = images.get(elem.imageId);
76 if (!img) {
77 throw new Error(`point3D ${pointId}: track references missing image_id=${elem.imageId}`);
78 }
79 if (elem.point2DIdx >= img.points2D.length) {
80 throw new Error(
81 `point3D ${pointId}: track element image_id=${elem.imageId} point2D_idx=${elem.point2DIdx} ` +
82 `out of range (image has ${img.points2D.length} points2D)`,
83 );
84 }
85 }
86 }
87}
88
89const missingFixture = !hasSparseBinaryFixture(BIN) || !existsSync(WASM_JS) || !existsSync(WASM_BIN);
90

Callers 1

integrity.test.tsFile · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected