(
files: Map<string, File>,
options: { requirePoints3D: boolean }
)
| 48 | } |
| 49 | |
| 50 | function findColmapFilesInternal( |
| 51 | files: Map<string, File>, |
| 52 | options: { requirePoints3D: boolean } |
| 53 | ): ColmapFileSelection { |
| 54 | // Resolve the best COLMAP model directory from the dropped/scanned paths. |
| 55 | // The resolver returns the exact map keys it selected, so each maps straight |
| 56 | // back to its File. Works for sparse/0, colmap/, the root, or nested layouts. |
| 57 | const selection = resolveColmapPaths(files.keys(), { |
| 58 | requirePoints3D: options.requirePoints3D, |
| 59 | }); |
| 60 | if (!selection) { |
| 61 | return {}; |
| 62 | } |
| 63 | |
| 64 | return { |
| 65 | camerasFile: selection.cameras ? files.get(selection.cameras) : undefined, |
| 66 | imagesFile: selection.images ? files.get(selection.images) : undefined, |
| 67 | points3DFile: selection.points3D ? files.get(selection.points3D) : undefined, |
| 68 | databaseFile: selection.database ? files.get(selection.database) : undefined, |
| 69 | rigsFile: selection.rigs ? files.get(selection.rigs) : undefined, |
| 70 | framesFile: selection.frames ? files.get(selection.frames) : undefined, |
| 71 | }; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Check if the file map contains COLMAP files |
no test coverage detected