Skip to main content

Module session

Module session 

Source
Expand description

State value and reducer: Session + step / poll / command / finish.

Each time the frame bundle of one position (FrameSet) arrives, it performs features -> matching of new pairs -> (first model / continued registration + triangulation) -> on zone completion, preview (foreground) densification + refinement (background thread: BA -> GPS ENU alignment -> densification), and emits that process as per-stage Events. It writes no files or logs (run.log lines also go out as Event::Log).

§Throughput

§State and sharing

Session is a value. step(&s, frames) returns a new Session and s can still be used. Models, image lists, correspondence graphs etc. are shared via Arc / copy on write. However, the feature store is append-only shared data, so calling step twice from the same earlier value with different frames mixes up the store (rewind with Command::ResetFrom). Background refinement results (refined models and point clouds) and the event version number are also shared by the whole session lineage.

§Event delivery

  • Default: foreground events go out in the return vector of that call; background refinement events accumulate in an internal inbox and go out at the front of the return vector of the next step/poll/command/finish.
  • If a receiver is set with Session::set_sink, all events (foreground and background) are delivered to it in version order as soon as they are emitted. In that case the foreground events in the return vector are copies of what was already delivered (do not deliver them again). The receiver must not block (it is called inside an internal lock).
  • meta.version increases monotonically across the whole session lineage and gives the emission order (= timeline order).

§Rules for reproducing run.log and timeline (for output hooks)

  • The timeline text is given by Event::timeline_text, and it is also written to run.log in the same place as [HH:MM:SS] text.
  • Event::Log is one run.log line at that place (with a [HH:MM:SS] prefix if stamped).
  • Event::Warning/Event::Error go out together with a Log of the same content, so do not write them to run.log separately.
  • The stage times of Event::Finished have no post-processing (“post”) time (post-processing is done by the output hook).

Structs§

FrameImage
One image of one position.
FrameSet
Frame bundle of one position (one image per camera).
PreviewZone
Zone preview result.
RefinedZone
Zone refined result (present from the time the pose is finalized; the point cloud exists once densification finishes).
Session
Incremental reconstruction state value.
SessionConfig
Session settings.
SparseBackends
Backends of the sparse stages that run per position. All CPU by default.

Enums§

Input
Reducer input.

Functions§

command
Command handling.
finish
Close the remaining zones -> wait for background jobs -> summary.
intrinsics_change
Largest relative change of a focal parameter (fx, fy; just f for single-focal models) over the cameras present in both a and b, as a fraction of a’s value. Infinite when a camera changed its model kind; 0 when no camera is shared.
pairs_for
Pairing rule: same camera at position gaps 1..5, 8, 16 / different cameras at position difference 0..4. Only pairs involving an image of position p, as sorted name pairs.
poll
Collect background refinement events (when there is no receiver). The state does not change.
step
The new state and events after processing the next frame bundle.
zones_upto
Zones: start = 0, span, …; [start-ovl, start+span+ovl) intersect [0, total). Completion position = hi-1.

Type Aliases§

EventSink
Immediate-delivery receiver.