Skip to content

Commit d257f4f

Browse files
Add unit tests for annotation_gui_gcp run_ba
Summary: Adds a `python_unittest` target, `annotation_gui_gcp/tests:test_run_ba`, for `annotation_gui_gcp/run_ba.py`, which had no unit test coverage (716 executable lines). The tests build a synthetic scene: two reconstructions of three cameras each, plus five ground control points (GCPs) projected into every view. Reconstruction B is offset by a known similarity transform. Behavior covered: - `merge_reconstructions` prefixes point ids per source reconstruction, keeps colors and observations, and tolerates shots missing from the tracks manager. `resplit_reconstruction` restores the original split and skips removed points. - `triangulate_gcps`, `gcp_geopositional_error` (including NaN for GCPs without an lla position or with one view), and `reproject_gcps` (reprojection, errors, observations outside the reconstruction, untriangulatable GCPs) - `get_sorted_reprojection_errors`, `get_number_of_wrong_annotations_per_gcp`, and `compute_gcp_std` (NaN filtering) - `find_alignment` recovers the similarity and skips missing points. `align_3d_annotations_to_reconstruction` maps GCPs into a 3D model frame and returns `None` with fewer than 3 triangulated GCPs. - `add_gcp_to_bundle` uses triangulated coordinates, falls back to the lla position, and skips unusable GCPs - `resect_image` and `resect_annotated_single_images` resect an out-of-reconstruction image from GCP annotations - `fix_3d_annotations_in_gcp_file` and `load_3d_annotations_from_gcp_file` - `align` end to end on an on-disk dataset: missing input files, single reconstruction (3D model alignment only), and rigid two-reconstruction alignment, checking the written reconstructions, reprojections, and metrics - `parse_args` defaults, the rigid/covariance conflict, and `main` forwarding the arguments to `align` Not covered, because these paths fail against the current opensfm APIs and would need production fixes: - `bundle_with_fixed_images` (the `--covariance` path) calls `BundleAdjuster.add_shot`, which no longer exists - the non-rigid `align` path calls `orec.bundle(..., {}, ...)` with empty rig camera priors, which raises `IndexError` (`_Map_base::at`) ___ landed-with-radar-review Differential Revision: D125284298 fbshipit-source-id: 0f8d9d44bc09649b6615bf89cc9eb5dd423e1491
1 parent 540663c commit d257f4f

1 file changed

Lines changed: 503 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)