Enrich SfM report by rperrot · Pull Request #2444 · openMVG/openMVG · GitHub
Skip to content

Enrich SfM report - #2444

Open
rperrot wants to merge 1 commit into
openMVG:developfrom
rperrot:enhance_report
Open

rperrot wants to merge 1 commit into
openMVG:developfrom
rperrot:enhance_report

Conversation

@rperrot

@rperrot rperrot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

This PR enriches the SfM reconstruction report (Generate_SfM_Report in sfm_report.cpp) with comprehensive statistics and SVG visualizations to provide deeper insights into 3D reconstruction quality and ease comparisons across different feature detectors/matchers.

Key Enhancements

  1. Track Length Distribution & Statistics:
    • Fix truncation bug: Previously, the mean track length was cast to IndexT (e.g., 2.89 became 2), hiding structural differences between methods. It is now computed and displayed as a floating-point value (double).
    • Added exhaustive distribution metrics: min, max, mean, median, standard deviation, and percentiles (P25, P50, P75, P90, P95, P99).
    • Added a Categorized Breakdown table (2 views minimal, 3 views short, 4–5 views medium, 6–9 views good, 10+ views robust) with track counts, % tracks, observation counts, and % observations.
    • Added a Detailed Occurrence table length-by-length (with individual % and cumulative %).
    • Generated and embedded a dedicated tracks_histogram.svg.
  2. Triangulation Conditioning & Parallax Angles ($\theta_{\max}$):
    • Evaluates triangulation robustness by computing the maximum ray angle between observing camera pairs for each 3D landmark:
      $$\theta_{\max} = \max_{i < j} \arccos\left(\frac{(\mathbf{X} - \mathbf{C}_i) \cdot (\mathbf{X} - \mathbf{C}_j)}{|\mathbf{X} - \mathbf{C}_i|_2 |\mathbf{X} - \mathbf{C}_j|_2}\right)$$
    • Reports angular distribution summary (min, mean, median, percentiles, max) and distribution bands ($< 2^\circ$ ill-conditioned, $[2^\circ, 5^\circ)$, $[5^\circ, 10^\circ)$, $[10^\circ, 20^\circ)$, $\ge 20^\circ$ wide baseline).
    • Generated and embedded parallax_angles_histogram.svg.
  3. Camera Covisibility Graph:
    • Computes connected camera pairs (sharing $\ge 1$ point and $\ge 30$ points).
    • Reports shared landmark statistics per pair (min / median / mean / max).
  4. 2D Reprojection Error (Vector Norm):
    • Added 2D Euclidean norm error metrics ($e = |\mathbf{r}|_2$): 2D RMSE, mean, median, P25..P99, max, and error distribution bands ($[0, 0.5]$ px, $(0.5, 1.0]$ px, $(1.0, 2.0]$ px, $> 2.0$ px).
    • 100% Backward compatible: The historical 1D coordinate RMSE and per-view residual table are preserved.
  5. Terminal Summary Logging:
    • Automatically logs a clean, structured summary in the console (OPENMVG_LOG_INFO) upon report generation.
  6. Unit Tests:
    • Added a dedicated unit test executable openMVG_test_sfm_report testing:
      • Empty scene handling (clean failure without file creation).
      • Synthetic multi-view scene (verifies report generation, HTML sections, and SVG outputs).

…tatistics

- Add comprehensive track length statistics (floating-point mean, percentiles, categorized breakdown, occurrence table, and SVG histogram)
- Add triangulation parallax angle analysis (theta_max distribution and SVG histogram)
- Add camera covisibility graph connectivity metrics
- Add 2D reprojection error norm statistics and residual distribution bands
- Add console summary log and dedicated unit test (openMVG_test_sfm_report)
@rperrot

rperrot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant