| 31 | const UNMATCHED = -1n; |
| 32 | |
| 33 | function makeReconstruction(points: Map<bigint, Point3D>): Reconstruction { |
| 34 | const cameras = new Map<number, Camera>([[ |
| 35 | 1, |
| 36 | { |
| 37 | cameraId: 1, |
| 38 | modelId: CameraModelId.PINHOLE, |
| 39 | width: 1024, |
| 40 | height: 768, |
| 41 | params: [500, 500, 512, 384], |
| 42 | }, |
| 43 | ]]); |
| 44 | // One throwaway image so writeImagesBinary has something to serialize. |
| 45 | const images = new Map<number, Image>([[ |
| 46 | 1, |
| 47 | { |
| 48 | imageId: 1, |
| 49 | qvec: [1, 0, 0, 0], |
| 50 | tvec: [0, 0, 0], |
| 51 | cameraId: 1, |
| 52 | name: 'dummy.jpg', |
| 53 | points2D: [], |
| 54 | }, |
| 55 | ]]); |
| 56 | return { |
| 57 | cameras, |
| 58 | images, |
| 59 | points3D: points, |
| 60 | imageStats: new Map(), |
| 61 | connectedImagesIndex: new Map(), |
| 62 | imageToPoint3DIds: new Map(), |
| 63 | globalStats: { |
| 64 | minError: 0, maxError: 0, avgError: 0, |
| 65 | minTrackLength: 0, maxTrackLength: 0, avgTrackLength: 0, |
| 66 | totalObservations: 0, totalPoints: 0, |
| 67 | }, |
| 68 | }; |
| 69 | } |
| 70 | |
| 71 | function makePoint(id: bigint, xyz: [number, number, number]): Point3D { |
| 72 | return { |