pub struct SessionConfig {Show 23 fields
pub image_root: PathBuf,
pub gps: Vec<GpsRecord>,
pub span: usize,
pub overlap: usize,
pub total_positions: Option<usize>,
pub incremental_triangulation: bool,
pub fixed_enu_origin: bool,
pub seed: Option<u64>,
pub extraction: ExtractionOptions,
pub sift: Arc<dyn SiftEngine>,
pub matcher: Arc<dyn MatcherBackend>,
pub ba_backend: Arc<dyn BaBackend>,
pub sparse: SparseBackends,
pub dense: Option<DenseConfig>,
pub history: usize,
pub decode_frames: bool,
pub stable_display: bool,
pub gps_prior_sigma: f64,
pub settle_tol: f64,
pub settle_max_zone: usize,
pub intrinsics_prior: Option<Arc<IntrinsicsPrior>>,
pub lookahead: usize,
pub preview: bool,
}Expand description
Session settings.
Fields§
§image_root: PathBufInput image folder (base of the image names).
gps: Vec<GpsRecord>GPS records (alignment order = this order).
span: usizeZone size and overlap (in units of positions).
overlap: usizeZone overlap (number of positions).
total_positions: Option<usize>Total number of known positions. If set, the last zones are closed at the last position; if not, they are closed in finish.
incremental_triangulation: boolTriangulate only newly registered images.
fixed_enu_origin: boolFix the ENU origin to the first GPS record (default: the first common record at each alignment).
seed: Option<u64>RANSAC seed for two-view geometry and GPS alignment.
extraction: ExtractionOptionsFeature extraction options.
sift: Arc<dyn SiftEngine>SIFT backend.
matcher: Arc<dyn MatcherBackend>Descriptor matching backend.
ba_backend: Arc<dyn BaBackend>Bundle adjustment backend (zone refinement BA, BA of the first model’s global mapper).
sparse: SparseBackendsSparse-stage backends (geometric verification, registration, triangulation).
dense: Option<DenseConfig>Densification settings (None = skip densification, point-cloud events carry dense: false).
history: usizeNumber of per-position rewind points kept for Command::ResetFrom (0 = no rewind, saves memory).
decode_frames: boolDecode input frames to RGB and emit them as Event::FrameDecoded before processing (off by default).
stable_display: boolStable display (default off). No preview densification; the refinement of zone K waits for zone K−1, takes the
cameras already shown by it (pose and intrinsics, copied exactly) as fixed in its bundle adjustment, and is not
re-aligned to GPS, so a zone never moves after it is shown and the space only grows. The coordinate frame is
the first refined zone’s (local). AllRefinedDone::chain is the final model aligned to GPS (ENU) once.
gps_prior_sigma: f64Stable display: standard deviation (m) of the GPS position prior on each newly placed camera. ≤ 0 disables the prior (then the shown frame is local and drifts with the chain).
settle_tol: f64Stable display: until settled, every refined zone re-adjusts all earlier cameras and the intrinsics (shown zones are re-placed). Once the largest relative focal change between two consecutive refined models is below this (default 0.01 = 1 %), the display settles: from then on shown cameras and intrinsics are frozen.
settle_max_zone: usizeStable display: the display settles by force at this zone at the latest (default 3).
intrinsics_prior: Option<Arc<IntrinsicsPrior>>Soft intrinsics prior (see crate::intrinsics): every camera starts from the prior values as soon as it exists and
each refinement pulls its refined parameters back towards them. None = off.
lookahead: usizePositions whose features may be extracted ahead of the position loop (default 0 = off). A Lookahead handle
(Session::lookahead) gets the frame sets of upcoming positions; one worker thread extracts at most this many of them
into the feature store while the earlier positions are matched, registered and triangulated. The results are the same as
without lookahead.
preview: boolStable display: show a sparse preview of every zone as soon as it closes (default off). The zone’s registered points (no
bundle adjustment yet) are placed into the display frame (robust Sim3 on the 3D points shared with the latest shown zone;
before any zone is shown, the GPS ENU fit the first refined zone uses) and emitted as an Event::ZonePreview with
dense: false and frame: "display". The refined zone later replaces it. Shown zones are never touched.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn new(image_root: impl Into<PathBuf>) -> Self
pub fn new(image_root: impl Into<PathBuf>) -> Self
Defaults: zone 12 / overlap 2, SIFT up to 8192 features and input 3200, CPU SIFT and matching, no densification, rewind 8.
Examples found in repository?
49fn main() -> Result<(), String> {
50 let out = std::env::args().nth(1).map(PathBuf::from).unwrap_or_else(|| std::env::temp_dir().join("cumulus3d_hooks"));
51 let src = out.with_extension("src");
52 if !src.join("gps_ref.txt").exists() {
53 common::make_dataset(&src);
54 }
55 if out.exists() {
56 std::fs::remove_dir_all(&out).map_err(|e| e.to_string())?;
57 }
58 let layout = Layout::discover(&src, 1)?;
59 let npos = layout.frames.len();
60
61 let mut cfg = SessionConfig::new(src.join("images"));
62 cfg.gps = read_gps_file(src.join("gps_ref.txt")).map_err(|e| e.to_string())?;
63 (cfg.span, cfg.overlap, cfg.total_positions, cfg.seed) = (4, 1, Some(npos), Some(7));
64 if cumulus3d_cuda::is_available() {
65 let mut d = DenseConfig::new(make_pm_backend("cuda"), parse_profile("fast")?);
66 d.undistort.max_image_size = 160;
67 cfg.dense = Some(d);
68 }
69
70 // Hook: print event text, zone point-cloud point counts, warnings and errors; plus the default output hook (files).
71 let pipeline = Pipeline::new(Session::new(cfg))
72 .on_any(|e: &Event| {
73 if let Some(t) = e.timeline_text() {
74 println!("[event v{}] {t}", e.meta().version);
75 }
76 })
77 .on(EventKind::ZonePreview, |e: &Event| {
78 if let Event::ZonePreview { range, cloud, model, .. } = e {
79 println!(" 초벌 {}: 조밀 점 {} / 희소 점 {}", range.zone, cloud.len(), model.num_points3d());
80 }
81 })
82 .on(EventKind::ZoneRefined, |e: &Event| {
83 if let Event::ZoneRefined { range, cloud, model, .. } = e {
84 println!(" 정밀 {}: 조밀 점 {} / 희소 점 {}", range.zone, cloud.len(), model.num_points3d());
85 }
86 })
87 .on_message(|k, m| eprintln!(" {k:?}: {m}"));
88 let mut pipeline = sinks::attach(pipeline, &out, &SinkOptions::default()).map_err(|e| e.to_string())?;
89
90 for p in 0..npos {
91 pipeline.push(Input::Frames(FrameSet::new(CAMS.iter().map(|c| (*c, layout.name(c, p))))));
92 }
93 let (_, summary) = pipeline.finish();
94 println!("이벤트 {} 개, 훅 호출 {} 번, 훅 패닉 {}", summary.events, summary.hook_calls, summary.hook_panics);
95
96 for f in ["timeline.txt", "run.log", "snapshots/manifest.json", "snapshots/timeline.txt", "DONE"] {
97 let p = out.join(f);
98 println!("{} {}", if p.exists() { "있음" } else { "없음" }, p.display());
99 }
100 Ok(())
101}Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SessionConfig
impl !UnwindSafe for SessionConfig
impl Freeze for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.