pub struct NodeBuilder { /* private fields */ }Expand description
Records a node configuration; NodeBuilder::build checks it and creates the node on a host.
The reconstruction settings are a Plan (same fields and TOML as crate::declare); the input folder is the
image root, positions/stride are not used (input is declared live), and GPS comes with each set.
Implementations§
Source§impl NodeBuilder
impl NodeBuilder
Sourcepub fn plan(self, plan: Plan) -> Self
pub fn plan(self, plan: Plan) -> Self
Replaces the reconstruction settings with a plan (e.g. read from TOML). Input positions/stride and
the GPS file are ignored; sinks are ignored (use NodeBuilder::output).
Sourcepub fn images(self, dir: impl Into<PathBuf>) -> Self
pub fn images(self, dir: impl Into<PathBuf>) -> Self
Image folder: file payloads are relative to it, in-memory payloads are spooled inside it.
Sourcepub fn cameras<S: Into<String>>(self, cams: impl IntoIterator<Item = S>) -> Self
pub fn cameras<S: Into<String>>(self, cams: impl IntoIterator<Item = S>) -> Self
Cameras of one synchronized set, in position order.
Sourcepub fn align(self, frame: AlignFrame) -> Self
pub fn align(self, frame: AlignFrame) -> Self
Coordinate alignment (ENU needs GPS fixes in the sets).
Sourcepub fn fixed_enu_origin(self, on: bool) -> Self
pub fn fixed_enu_origin(self, on: bool) -> Self
Fixes the ENU origin at the first GPS fix.
Sourcepub fn match_backend(self, name: &str) -> Self
pub fn match_backend(self, name: &str) -> Self
Descriptor matching backend (cpu | cuda).
Sourcepub fn gpu(self) -> Self
pub fn gpu(self) -> Self
CUDA for features, matching, the sparse stages, densification, undistortion and bundle adjustment.
Sourcepub fn stable_display(self, on: bool) -> Self
pub fn stable_display(self, on: bool) -> Self
Stable display (see SessionConfig::stable_display): intrinsics are settled then frozen, later zones are anchored to the
shown ones with shared 3D points, and shown zones are re-densified in place (ZoneRefined of an earlier zone again), so
the displayed cloud only gets refined and never jumps. Settle parameters come from the plan (sparse.settle_tol,
sparse.settle_max_zone). Combine with NodeBuilder::fixed_enu_origin(true) for a display in a fixed ENU frame.
Sourcepub fn display_deltas(self, opts: LiveOptions) -> Self
pub fn display_deltas(self, opts: LiveOptions) -> Self
Computes the in-memory display updates in the library: after every dense zone result a point-keyed
Event::DisplayDelta is delivered to subscribers and hooks (EventKind::DisplayDelta). Thinning (stride), overlap
voxel ownership and zone composition follow crate::post::LiveDisplay; relocate is decided by the node (on only
when previews exist). Needs dense clouds with point keys (.dense(..), which the session always keys). The composition runs on
the composing thread right after the causing event; the ENU origin reported in the delta frame is the first GPS fix
declared.
Sourcepub fn incremental_triangulation(self, on: bool) -> Self
pub fn incremental_triangulation(self, on: bool) -> Self
Triangulate only newly registered images.
Sourcepub fn lookahead(self, positions: usize) -> Self
pub fn lookahead(self, positions: usize) -> Self
Feature lookahead (see SessionConfig::lookahead, default 2; 0 = off): on a spawned node (ReconNode::spawn) the
features of up to this many queued positions are extracted by a worker thread while earlier positions are matched,
registered and triangulated, so the throughput approaches the slowest stage instead of the sum of the stages. Nothing
is read ahead for sets whose payload is raw RGB pixels (their spooling stays on the worker). Results do not change.
Sourcepub fn batch(self, threshold: usize) -> Self
pub fn batch(self, threshold: usize) -> Self
Backlog batching (default 1 = off; 0 or 1 = off): when a spawned node finds at least threshold states waiting (the one it
takes plus the queued ones), it processes up to 32 of them as one batch (ReconNode::compose_batch): features,
matching of all pending pairs in one call, registration and triangulation once per batch (split where a zone closes), so
a backlog is worked off at the cost of one triangulation instead of one per position. The result is equivalent to
position by position within the tolerance of registration order. Off with ReconcilePolicy::ReplayWindow (a rewind
needs the state after every position).
Sourcepub fn preview(self, on: bool) -> Self
pub fn preview(self, on: bool) -> Self
Stable display: a sparse preview of every zone as soon as it closes (see SessionConfig::preview), before the refined
zone replaces it. With NodeBuilder::display_deltas it arrives as a crate::live::DeltaKind::Preview delta.
Sourcepub fn settle(self, tol: f64, max_zone: usize) -> Self
pub fn settle(self, tol: f64, max_zone: usize) -> Self
Stable display settling: intrinsics change tolerance and the last zone that may still settle
(see SessionConfig::settle_tol, SessionConfig::settle_max_zone).
Sourcepub fn live_stride(self, stride: usize) -> Self
pub fn live_stride(self, stride: usize) -> Self
Live display thinning of the live diff stream: keep 1 of stride points by key hash (1 = keep all; default 6).
Sourcepub fn stream_origin(self, lat: f64, lon: f64, alt: f64) -> Self
pub fn stream_origin(self, lat: f64, lon: f64, alt: f64) -> Self
Geodetic origin [lat, lon, alt] written to the live diff stream manifest. Give the first GPS fix the node will see
(with NodeBuilder::fixed_enu_origin it is the origin of every zone); without it the manifest frame is display.
Sourcepub fn stream_only(self, on: bool) -> Self
pub fn stream_only(self, on: bool) -> Self
With NodeBuilder::stable_display and NodeBuilder::output: write only run.log, the timeline and the live diff
stream, not the zone PLYs, the display PLYs, the per-zone models or the post-processing snapshots (default off).
Sourcepub fn reconcile(self, p: ReconcilePolicy) -> Self
pub fn reconcile(self, p: ReconcilePolicy) -> Self
Reconciliation policy (default ReconcilePolicy::AppendOnly).
Sourcepub fn backpressure(self, b: Backpressure) -> Self
pub fn backpressure(self, b: Backpressure) -> Self
Producer queue policy for ReconNode::spawn (default Block { max_pending: 8 }).
Sourcepub fn source(self, id: impl Into<String>) -> Self
pub fn source(self, id: impl Into<String>) -> Self
Accept only this source id (default: the first declared source).
Sourcepub fn spool(self, rel: impl Into<PathBuf>) -> Self
pub fn spool(self, rel: impl Into<PathBuf>) -> Self
Spool folder for in-memory payloads, relative to the image folder (default .live).
Sourcepub fn output(self, dir: impl Into<PathBuf>, opts: SinkOptions) -> Self
pub fn output(self, dir: impl Into<PathBuf>, opts: SinkOptions) -> Self
Writes the standard output files (timeline, run.log, zone PLYs, snapshots) to dir. With
NodeBuilder::stable_display also the live diff stream (live/stream/).
Sourcepub fn on<F>(self, kind: EventKind, f: F) -> Self
pub fn on<F>(self, kind: EventKind, f: F) -> Self
Hook for one event kind (Pipeline::on). FrameDecoded turns frame decoding on.
Sourcepub fn on_event<F>(self, f: F) -> Self
pub fn on_event<F>(self, f: F) -> Self
Hook for every event (Pipeline::on_any).
Sourcepub fn on_frame<F>(self, f: F) -> Self
pub fn on_frame<F>(self, f: F) -> Self
Decoded input frames (Pipeline::on_frame); turns frame decoding on.
Sourcepub fn on_zone_preview<F>(self, f: F) -> Self
pub fn on_zone_preview<F>(self, f: F) -> Self
Zone preview clouds (Pipeline::on_zone_preview).
Sourcepub fn on_zone_refined<F>(self, f: F) -> Self
pub fn on_zone_refined<F>(self, f: F) -> Self
Zone refined clouds (Pipeline::on_zone_refined).
Sourcepub fn on_message<F>(self, f: F) -> Self
pub fn on_message<F>(self, f: F) -> Self
Warnings and errors (Pipeline::on_message); includes reconciliation warnings.
Sourcepub fn event_policy(self, kind: EventKind, p: QueuePolicy) -> Self
pub fn event_policy(self, kind: EventKind, p: QueuePolicy) -> Self
Per-kind hook queue policy (Pipeline::policy), e.g. LatestPerKey for ZonePreview.
Sourcepub fn sync_hooks(self, on: bool) -> Self
pub fn sync_hooks(self, on: bool) -> Self
Runs hooks synchronously on the composing thread (Pipeline::sync).
Sourcepub fn intrinsics_prior(self, prior: IntrinsicsPrior) -> Self
pub fn intrinsics_prior(self, prior: IntrinsicsPrior) -> Self
Soft intrinsics prior (the CLI’s --intrinsics-prior): every camera starts from the given parameters (except the
principal point) and the bundle adjustment is pulled towards them with the prior’s σ values. Cameras are keyed by
camera name (one of NodeBuilder::cameras) or by id; a camera without an entry is left alone. Checked by build.
use cumulus3d_cli::compose::ReconNode;
use cumulus3d_cli::intrinsics::IntrinsicsPrior;
let prior = IntrinsicsPrior::new()
.sigmas(0.005, 0.01) // focal: relative, distortion: absolute
.opencv("camF", [1607.4, 1611.2, 1024.0, 576.0, 0.082, -0.084, 0.0013, 0.0014]);
let _builder = ReconNode::declare().images("live/images").cameras(["camF"]).intrinsics_prior(prior);Sourcepub fn intrinsics_prior_json(self, path: impl AsRef<Path>) -> Self
pub fn intrinsics_prior_json(self, path: impl AsRef<Path>) -> Self
Reads the prior from a JSON file (same format as the CLI’s --intrinsics-prior; default σ values 0.005 / 0.01).
A read or parse error is reported by build. For other σ values use IntrinsicsPrior::load and
NodeBuilder::intrinsics_prior.
Sourcepub fn build(self, host: &CompositionHost) -> Result<ReconNode, ComposeError>
pub fn build(self, host: &CompositionHost) -> Result<ReconNode, ComposeError>
Checks the configuration, creates the session and pipeline, and registers the node on host.
Creates the image folder’s spool folder; nothing else is written until frames are declared.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NodeBuilder
impl !Sync for NodeBuilder
impl !UnwindSafe for NodeBuilder
impl Freeze for NodeBuilder
impl Send for NodeBuilder
impl Unpin for NodeBuilder
impl UnsafeUnpin for NodeBuilder
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> 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.