Skip to content

Add geometricFilterFromPoses to build filters from known poses - #2201

Merged
servantftransperfect merged 6 commits into
developfrom
dev/filterFromSfmData
Oct 15, 2026
Merged

servantftransperfect merged 6 commits into
developfrom
dev/filterFromSfmData

Conversation

@servantftransperfect

@servantftransperfect servantftransperfect commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a way to geometrically filter matches using known camera poses rather than models estimated from the matches. This is useful when poses are already available (for example from a previous reconstruction or an external tracking system) and we want to remove matches that don't fit them.

The new geometricFilterFromPoses software builds one filter for each pair of posed views. Its output uses the same format as geometricFilterEstimating, so geometricFilterApplying can consume it without any other change to the pipeline.

Features list

  • New rotation_matrix geometric filter type (EGeometricFilterType::ROTATION_MATRIX). This is a pure rotation model, bJ = R bI, used for pairs whose baseline is too small for reliable epipolar geometry. It can't be estimated from matches, so featureMatching rejects it with an explicit error.
  • New software aliceVision_geometricFilterFromPoses and its Meshroom node GeometricFilterFromPoses:
    • Reads the views that have both a pose and an intrinsic from an SfMData.
    • For each pair, it computes the relative motion and outputs one of two models:
      • an essential matrix E = [t]x R (with t normalized), defined on bearing vectors, so it works with any camera model;
      • a rotation matrix when |t| < minBaselineRatio * sceneScale. The scene scale is the median distance from the camera centers to their centroid.
    • Writes matches_0.json to the output folder.
    • Options: --threshold (pixels, default 4) and --minBaselineRatio (default 1e-3).
  • geometricFilterApplying (v1.1):
    • Loads filters from every matches_*.json file in the filters folder, then keeps only the pairs handled by the current chunk. Filter chunks no longer need to line up with the matching chunks.
    • Picks the inlier test from the filter type:
      • fundamental_matrix: epipolar distance on undistorted pixels, for pinhole cameras only;
      • essential_matrix: angular epipolar error on bearing vectors;
      • rotation_matrix: angle between R bI and bJ.
    • For the angular models, the pixel threshold is converted to an angle measured at the image center.
    • Skips pairs with invalid cameras or an unsupported filter type, and logs a warning with how many were skipped.

Implementation remarks

  • Building the filters in camera space (on bearing vectors) means fisheye and equidistant cameras are supported. Before this change, the fundamental-matrix error was computed on raw distorted pixels.
  • The pixel-to-angle conversion is measured at the image center. Near the image borders of wide-angle lenses, the threshold is only approximate.
  • geometricFilterFromPoses builds every pair of posed views (O(N²)). The filters are small, but very large scenes will produce a large JSON file.
  • The Meshroom GeometricFilterFromPoses node doesn't expose minBaselineRatio yet, so it uses the default.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Degenerate poses and Equidistant-camera filters can incorrectly reject valid matches.

2 open findings
What changed in this PR

Adds pose-based geometric filter generation and integrates it with the existing match-filtering pipeline.

Changes:

  • Adds the executable and Meshroom node for generating fundamental matrices from known poses.
  • Loads filters across all chunks and applies them to undistorted coordinates.
  • Updates build configuration, node versions, and SWIG include ordering.
File Description
main_geometricFilterFromPoses.cpp Generates pose-derived filters.
main_geometricFilterApplying.cpp Loads all filter files and undistorts points.
CMakeLists.txt Builds the new executable.
Camera.i Corrects SWIG include ordering.
GeometricFilterFromPoses.py Defines the new Meshroom node.
GeometricFilterApplying.py Updates the node version.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/software/pipeline/main_geometricFilterFromPoses.cpp Outdated
Comment thread src/software/pipeline/main_geometricFilterApplying.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Uncalibrated-filter compatibility, zero-baseline handling, and directional pixel tolerances need correction.

3 open findings
2 resolved since last review

🧠 Review effort: Balanced

Comment thread src/software/pipeline/main_geometricFilterApplying.cpp Outdated
Comment thread src/software/pipeline/main_geometricFilterApplying.cpp
Comment thread src/software/pipeline/main_geometricFilterFromPoses.cpp
Fabien Servant and others added 4 commits October 15, 2026 12:37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oAngle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fabien Servant and others added 2 commits October 15, 2026 12:48
Test inliers with an error matching the filter type: epipolar distance on
undistorted pixels for fundamental matrices (pinhole only), angular errors
on bearing vectors for essential and rotation matrices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@servantftransperfect
servantftransperfect merged commit 425af12 into develop Oct 15, 2026
5 checks passed
@servantftransperfect
servantftransperfect deleted the dev/filterFromSfmData branch October 15, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants