SIGN IN SIGN UP

Fix SIGABRT in RegisterNextStructureLessImage when NumRegImages < 2 (#4405)

## Summary

Replace a hard `THROW_CHECK_GE` in `RegisterNextStructureLessImage` with
a graceful `LOG(WARNING) + return false`, preventing a crash when the
mapper attempts structure-less registration with fewer than 2 registered
images.

Fixes #901.

## Context

On scenes with degenerate geometry the incremental mapper may register
only 0–1 images before attempting structure-less registration of a
candidate. The existing `THROW_CHECK_GE(reconstruction_->NumRegImages(),
2)` at line 620 calls `std::abort()` (SIGABRT) in this case.

The caller in `incremental_pipeline.cc` (~line 553) already handles
`return false` gracefully — it tries other candidates or falls back to
different registration strategies. The check is a precondition that
should be a soft guard, not a fatal assertion.

## Precedent

PR #4344 applied the identical `THROW_CHECK → if + return false` pattern
to `AdjustGlobalBundle` (line ~1084) for the analogous
`ba_config.NumImages() < 2` case, merged April 2026. This is the same
class of fix for a different function in the same file.

## Test plan

- [x] Verified on a real scene (urban rig capture) that previously
SIGABRT'd at this CHECK with only 1 registered image — now logs a
warning and the mapper continues gracefully
- [x] No behavior change for scenes that register ≥ 2 images (the guard
is never hit)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Shaohui Liu <b1ueber2y@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Á
Áron Monszpart committed
bc8b09c132a7465dcccbb9d66f49107a2fa2aaa6
Parent: cdb6598
Committed by GitHub <noreply@github.com> on 5/17/2026, 8:44:23 AM