Skip to content

Add Sfm camera repair interface - #138

Open
ehallein wants to merge 5 commits into
harry7557558:masterfrom
ehallein:master
Open

ehallein wants to merge 5 commits into
harry7557558:masterfrom
ehallein:master

Conversation

@ehallein

@ehallein ehallein commented Oct 3, 2026

Copy link
Copy Markdown

A reconstruction often comes out mostly right: a few cameras sit in the wrong place and a few images never register. This adds a way to fix just those, against the rest of the model, without reconstructing again. Every step works on bearings, so pinhole, fisheye and equirect cameras all go through the same path. There is a new Repair tab on the Reconstruction Editor. See camera-repair.md for instructions. I have it used to repair real reconstructions already.

What's in it

  • Mapper::repair / spirula sfm repair
    • Re-places named cameras (--replace).
    • Snaps hand-placed poses (--hints).
    • Registers missing images (--add, --add-missing).
    • Optionally audits every camera (--audit).
    • Targets are matched against the model first, and the new pairs are appended to matches.bin (the original is kept as .orig).
    • The result is fitted back onto the untouched cameras, so the model's frame stays put.
  • Editor Repair tab
    • Re-place selected cameras, or move them by hand (G/R) and snap them.
    • Check every camera.
    • Register missing images.
    • The result is previewed in colour, then kept (with .orig backups and a reopen) or discarded with undo intact.
  • Camera photo panel: Previous/Next, Look through (puts the view at the camera with its lens), and the photo laid over the viewport.
  • Missing images
    • A list of the images with features but no camera.
    • Guess places takes a pose from another model in sparse/ (aligned on the cameras they share) or interpolates between file-order neighbours.
    • Place at view sets a pose by hand.
    • Placed images are retried as their neighbours register, so a whole missing stretch goes in one run.
  • Docs: docs/notes/camera-repair.md (user guide) and the repair section of src/sfm/README.md.

Testing

  • sfm_repair_test: pinhole and equirect scenes; named, hinted and audited cameras return to their poses, and missing images register.
  • Real 40-frame equirect: repaired cameras land within 0.01°.
  • Real 30-frame pinhole: all cameras within 0.26° after their matches were stripped.
  • 1,092-frame equirect boardwalk, run in the GUI on a test copy:
    • 49 missing images (46 of which had split off into their own small model) all registered, from 1,043 to 1,092 cameras.
    • Existing cameras moved at most 0.05% of the scene size and 0.12°.
    • The camera path runs evenly through both former gaps.
  • Comment, i18n (all 13 languages), font coverage and citation checks pass.

Limitations

  • Binary COLMAP models only.
  • Uses the default matcher.
  • Cameras added in the preview can't be selected.
  • map --resume still doesn't read rigs.txt.

ehallein and others added 4 commits October 3, 2026 15:38
A nearly-right reconstruction can now be fixed instead of re-run:
cameras the user names as wrong are taken out and placed again, cameras
moved by hand are snapped from there, and missing images are registered.
The targets are matched against the model first and the new pairs join
matches.bin. The result is fitted back onto the untouched cameras, so
the model's frame stays put. Works for equirect as for any other model.

- Mapper::repair, with the audit fan-out shared with audit()
- sfm/Repair.{h,cpp} and `spirula sfm repair`
- prefilterPairsFor: targets scored against the model only
- the editor's Repair tab: re-place, move by hand + snap, register
  missing, check every camera; Keep or Discard the result
- sfm_repair_test on pinhole and equirect scenes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Repair tab shows the selected camera's photo, steps through the
cameras, and can put the view where a camera stands with its own lens,
which is how a wrong camera shows itself against the model. Cameras
moved by hand are drawn yellow, a repair's result green (red where it
could not place one) before it is kept, each beside a grey ghost of
where it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Repair tab lists images with features but no camera. Guess places
takes their poses from another model in sparse/ (aligned on shared
cameras) or between file-order neighbours; Place at view sets one by
hand, with the photo laid over the viewport. Register missing starts
placed images from there.

Mapper::repair retries hinted images until none lands, triangulating
after each, so a whole missing stretch registers in one run; leftover
new images fall through to growth.

Adds docs/notes/camera-repair.md, a user guide to the Repair tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add Sfm camera repair interface

This branch has not been deployed

No deployments
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.

2 participants