Skip to main content

Event

Enum Event 

Source
pub enum Event {
Show 24 variants FrameIngested { meta: Meta, position: usize, images: Vec<String>, }, Started { meta: Meta, positions: Option<usize>, }, Log { meta: Meta, line: String, stamped: bool, }, FeaturesExtracted { meta: Meta, image: String, count: usize, position: usize, image_id: ImageId, }, PairsMatched { meta: Meta, pairs: usize, verified: usize, position: usize, matched: usize, }, ModelInitialized { meta: Meta, registered: usize, position: usize, model: Arc<Reconstruction>, }, FrameRegistered { meta: Meta, position: usize, image: String, image_id: ImageId, cam_from_world: Rigid3, }, PositionDone { meta: Meta, position: usize, registered: usize, expected: usize, }, ZoneArrived { meta: Meta, range: ZoneRange, model: Arc<Reconstruction>, }, ZonePreview { meta: Meta, range: ZoneRange, cloud: Arc<PointCloud>, model: Arc<Reconstruction>, dense: bool, frame: String, }, RefineStarted { meta: Meta, zone: usize, }, ZoneAdjusted { meta: Meta, zone: usize, model: Arc<Reconstruction>, }, ZoneRefinedPose { meta: Meta, range: ZoneRange, registered: usize, mean_reproj_px: f64, model: Arc<Reconstruction>, }, ZoneRefined { meta: Meta, range: ZoneRange, cloud: Arc<PointCloud>, model: Arc<Reconstruction>, dense: bool, }, BaseAdopted { meta: Meta, zone: usize, }, Reanchored { meta: Meta, zone: usize, transform: Sim3, }, Snapshot { meta: Meta, index: usize, cloud: Arc<PointCloud>, }, AllPositionsDone { meta: Meta, }, AllRefinedDone { meta: Meta, chain: Option<Arc<Reconstruction>>, }, Finished { meta: Meta, pipeline_secs: f64, stage_times: Vec<(String, Duration, usize)>, chain_stats: Vec<String>, }, Reset { meta: Meta, position: usize, }, ZoneInvalidated { meta: Meta, zone: usize, }, Warning { meta: Meta, message: String, }, Error { meta: Meta, message: String, },
}
Expand description

파이프라인 이벤트(단계별 결과). 모든 변형에 Meta 가 붙는다.

Variants§

§

FrameIngested

위치 하나의 프레임 묶음이 들어옴.

Fields

§meta: Meta

공통 머리말.

§position: usize

위치 번호.

§images: Vec<String>

이 위치의 영상 이름들.

§

Started

세션 시작(첫 입력 때 한 번). positions = 알려진 전체 위치 수. (session 추가)

Fields

§meta: Meta

공통 머리말.

§positions: Option<usize>

알려진 전체 위치 수(모르면 None).

§

Log

run.log 한 줄. stamped 이면 [HH:MM:SS] 머리(meta.at 현지 시각)를 붙여 쓴다. (session 추가)

Fields

§meta: Meta

공통 머리말.

§line: String

기록할 줄.

§stamped: bool

[HH:MM:SS] 머리를 붙일지.

§

FeaturesExtracted

영상 하나의 특징 추출 완료.

Fields

§meta: Meta

공통 머리말.

§image: String

영상 이름.

§count: usize

추출한 특징 수.

§position: usize

위치 번호.

§image_id: ImageId

영상 id.

§

PairsMatched

새 짝 매칭 결과. pairs = 이번 위치에서 매칭한 짝 수, verified = 유효 기하 짝 수, matched = 기술자 매칭을 수행한 짝 수.

Fields

§meta: Meta

공통 머리말.

§pairs: usize

이번 위치에서 매칭한 짝 수.

§verified: usize

유효 기하 짝 수.

§position: usize

위치 번호.

§matched: usize

기술자 매칭을 수행한 짝 수.

§

ModelInitialized

첫 모델이 만들어짐.

Fields

§meta: Meta

공통 머리말.

§registered: usize

등록된 영상 수.

§position: usize

위치 번호.

§model: Arc<Reconstruction>

관련 모델 사본.

§

FrameRegistered

영상이 모델에 등록됨.

Fields

§meta: Meta

공통 머리말.

§position: usize

위치 번호.

§image: String

영상 이름.

§image_id: ImageId

영상 id.

§cam_from_world: Rigid3

등록된 자세(world → 카메라).

§

PositionDone

위치 하나의 등록·삼각측량이 끝남.

Fields

§meta: Meta

공통 머리말.

§position: usize

위치 번호.

§registered: usize

등록된 영상 수.

§expected: usize

이 위치까지 기대한 영상 수.

§

ZoneArrived

구역의 마지막 위치가 도착함. model = 그 시점 체인 모델 사본(정렬 전).

Fields

§meta: Meta

공통 머리말.

§range: ZoneRange

구역 범위.

§model: Arc<Reconstruction>

관련 모델 사본.

§

ZonePreview

구역 초벌 점군(BA 없음). model = 초벌 모델(구역 0 은 GPS 정렬본), dense = 거짓이면 조밀화를 하지 않았거나 실패해 cloud 가 빈 자리표시. frame = 점군 좌표계(“gps” | “refined_K” | “unaligned”).

Fields

§meta: Meta

공통 머리말.

§range: ZoneRange

구역 범위.

§cloud: Arc<PointCloud>

점군(조밀화가 없으면 빈 자리표시).

§model: Arc<Reconstruction>

관련 모델 사본.

§dense: bool

조밀화를 실제로 했는지.

§frame: String

점군 좌표계(“gps” | “refined_K” | “unaligned”).

§

RefineStarted

정밀 작업 시작(배경). (session 추가)

Fields

§meta: Meta

공통 머리말.

§zone: usize

구역 번호.

§

ZoneAdjusted

정밀 작업의 BA 직후 모델(GPS 정렬 전). (session 추가)

Fields

§meta: Meta

공통 머리말.

§zone: usize

구역 번호.

§model: Arc<Reconstruction>

관련 모델 사본.

§

ZoneRefinedPose

구역 정밀 자세 확정(BA + GPS 정렬). model = BA + GPS 정렬된 정밀 모델.

Fields

§meta: Meta

공통 머리말.

§range: ZoneRange

구역 범위.

§registered: usize

등록된 영상 수.

§mean_reproj_px: f64

평균 재투영 오차(픽셀).

§model: Arc<Reconstruction>

관련 모델 사본.

§

ZoneRefined

구역 정밀 점군. 같은 구역 초벌을 대체한다. dense = 거짓이면 cloud 는 빈 자리표시.

Fields

§meta: Meta

공통 머리말.

§range: ZoneRange

구역 범위.

§cloud: Arc<PointCloud>

점군(조밀화가 없으면 빈 자리표시).

§model: Arc<Reconstruction>

관련 모델 사본.

§dense: bool

조밀화를 실제로 했는지.

§

BaseAdopted

정밀 모델이 다음 등록의 기준으로 채택됨.

Fields

§meta: Meta

공통 머리말.

§zone: usize

구역 번호.

§

Reanchored

이미 보낸 구역의 좌표계 변환(점군은 다시 보내지 않음): new_from_old.

Fields

§meta: Meta

공통 머리말.

§zone: usize

구역 번호.

§transform: Sim3

new_from_old 변환.

§

Snapshot

화면용 스냅샷(사건 순서 번호와 합성 점군).

Fields

§meta: Meta

공통 머리말.

§index: usize

사건 순서 번호.

§cloud: Arc<PointCloud>

점군(조밀화가 없으면 빈 자리표시).

§

AllPositionsDone

모든 위치 처리 완료.

Fields

§meta: Meta

공통 머리말.

§

AllRefinedDone

모든 정밀 작업 완료. chain = 최종 체인 모델.

Fields

§meta: Meta

공통 머리말.

§chain: Option<Arc<Reconstruction>>

최종 체인 모델.

§

Finished

세션 종료 요약(모든 이벤트의 마지막). stage_times = (단계, 누적 시간, 횟수) 단계 이름순, pipeline_secs = 시작 ~ 모든 정밀 완료, chain_stats = 최종 체인 모델 통계 줄. (session 추가)

Fields

§meta: Meta

공통 머리말.

§pipeline_secs: f64

시작 ~ 모든 정밀 완료(초).

§stage_times: Vec<(String, Duration, usize)>

(단계, 누적 시간, 횟수) 단계 이름순.

§chain_stats: Vec<String>

최종 체인 모델 통계 줄.

§

Reset

Command::ResetFrom 처리됨. (session 추가)

Fields

§meta: Meta

공통 머리말.

§position: usize

위치 번호.

§

ZoneInvalidated

Command::InvalidateZone 처리됨. (session 추가)

Fields

§meta: Meta

공통 머리말.

§zone: usize

구역 번호.

§

Warning

경고.

Fields

§meta: Meta

공통 머리말.

§message: String

메시지.

§

Error

오류(훅 패닉 포함).

Fields

§meta: Meta

공통 머리말.

§message: String

메시지.

Implementations§

Source§

impl Event

Source

pub fn kind(&self) -> EventKind

이벤트 종류.

Source

pub fn meta(&self) -> &Meta

공통 머리말.

Examples found in repository?
examples/hooks.rs (line 46)
21fn main() -> Result<(), String> {
22    let out = std::env::args().nth(1).map(PathBuf::from).unwrap_or_else(|| std::env::temp_dir().join("cumulus3d_hooks"));
23    let src = out.with_extension("src");
24    if !src.join("gps_ref.txt").exists() {
25        common::make_dataset(&src);
26    }
27    if out.exists() {
28        std::fs::remove_dir_all(&out).map_err(|e| e.to_string())?;
29    }
30    let layout = Layout::discover(&src, 1)?;
31    let npos = layout.frames.len();
32
33    let mut cfg = SessionConfig::new(src.join("images"));
34    cfg.gps = read_gps_file(src.join("gps_ref.txt")).map_err(|e| e.to_string())?;
35    (cfg.span, cfg.overlap, cfg.total_positions, cfg.seed) = (4, 1, Some(npos), Some(7));
36    if cumulus3d_cuda::is_available() {
37        let mut d = DenseConfig::new(make_pm_backend("cuda"), parse_profile("fast")?);
38        d.undistort.max_image_size = 160;
39        cfg.dense = Some(d);
40    }
41
42    // 훅: 사건 문구 출력, 구역 점군 점 수, 경고·오류. 그리고 기본 출력 훅(파일).
43    let pipeline = Pipeline::new(Session::new(cfg))
44        .on_any(|e: &Event| {
45            if let Some(t) = e.timeline_text() {
46                println!("[event v{}] {t}", e.meta().version);
47            }
48        })
49        .on(EventKind::ZonePreview, |e: &Event| {
50            if let Event::ZonePreview { range, cloud, model, .. } = e {
51                println!("  초벌 {}: 조밀 점 {} / 희소 점 {}", range.zone, cloud.len(), model.num_points3d());
52            }
53        })
54        .on(EventKind::ZoneRefined, |e: &Event| {
55            if let Event::ZoneRefined { range, cloud, model, .. } = e {
56                println!("  정밀 {}: 조밀 점 {} / 희소 점 {}", range.zone, cloud.len(), model.num_points3d());
57            }
58        })
59        .on_message(|k, m| eprintln!("  {k:?}: {m}"));
60    let mut pipeline = sinks::attach(pipeline, &out, &SinkOptions::default()).map_err(|e| e.to_string())?;
61
62    for p in 0..npos {
63        pipeline.push(Input::Frames(FrameSet::new(CAMS.iter().map(|c| (*c, layout.name(c, p))))));
64    }
65    let (_, summary) = pipeline.finish();
66    println!("이벤트 {} 개, 훅 호출 {} 번, 훅 패닉 {}", summary.events, summary.hook_calls, summary.hook_panics);
67
68    for f in ["timeline.txt", "run.log", "snapshots/manifest.json", "snapshots/timeline.txt", "DONE"] {
69        let p = out.join(f);
70        println!("{} {}", if p.exists() { "있음" } else { "없음" }, p.display());
71    }
72    Ok(())
73}
Source§

impl Event

Source

pub fn timeline_text(&self) -> Option<String>

timeline.txt 의 사건 문구(없으면 None). 문구·형식은 기존 기록과 같다.

Examples found in repository?
examples/hooks.rs (line 45)
21fn main() -> Result<(), String> {
22    let out = std::env::args().nth(1).map(PathBuf::from).unwrap_or_else(|| std::env::temp_dir().join("cumulus3d_hooks"));
23    let src = out.with_extension("src");
24    if !src.join("gps_ref.txt").exists() {
25        common::make_dataset(&src);
26    }
27    if out.exists() {
28        std::fs::remove_dir_all(&out).map_err(|e| e.to_string())?;
29    }
30    let layout = Layout::discover(&src, 1)?;
31    let npos = layout.frames.len();
32
33    let mut cfg = SessionConfig::new(src.join("images"));
34    cfg.gps = read_gps_file(src.join("gps_ref.txt")).map_err(|e| e.to_string())?;
35    (cfg.span, cfg.overlap, cfg.total_positions, cfg.seed) = (4, 1, Some(npos), Some(7));
36    if cumulus3d_cuda::is_available() {
37        let mut d = DenseConfig::new(make_pm_backend("cuda"), parse_profile("fast")?);
38        d.undistort.max_image_size = 160;
39        cfg.dense = Some(d);
40    }
41
42    // 훅: 사건 문구 출력, 구역 점군 점 수, 경고·오류. 그리고 기본 출력 훅(파일).
43    let pipeline = Pipeline::new(Session::new(cfg))
44        .on_any(|e: &Event| {
45            if let Some(t) = e.timeline_text() {
46                println!("[event v{}] {t}", e.meta().version);
47            }
48        })
49        .on(EventKind::ZonePreview, |e: &Event| {
50            if let Event::ZonePreview { range, cloud, model, .. } = e {
51                println!("  초벌 {}: 조밀 점 {} / 희소 점 {}", range.zone, cloud.len(), model.num_points3d());
52            }
53        })
54        .on(EventKind::ZoneRefined, |e: &Event| {
55            if let Event::ZoneRefined { range, cloud, model, .. } = e {
56                println!("  정밀 {}: 조밀 점 {} / 희소 점 {}", range.zone, cloud.len(), model.num_points3d());
57            }
58        })
59        .on_message(|k, m| eprintln!("  {k:?}: {m}"));
60    let mut pipeline = sinks::attach(pipeline, &out, &SinkOptions::default()).map_err(|e| e.to_string())?;
61
62    for p in 0..npos {
63        pipeline.push(Input::Frames(FrameSet::new(CAMS.iter().map(|c| (*c, layout.name(c, p))))));
64    }
65    let (_, summary) = pipeline.finish();
66    println!("이벤트 {} 개, 훅 호출 {} 번, 훅 패닉 {}", summary.events, summary.hook_calls, summary.hook_panics);
67
68    for f in ["timeline.txt", "run.log", "snapshots/manifest.json", "snapshots/timeline.txt", "DONE"] {
69        let p = out.join(f);
70        println!("{} {}", if p.exists() { "있음" } else { "없음" }, p.display());
71    }
72    Ok(())
73}

Trait Implementations§

Source§

impl Clone for Event

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Event

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnsafeUnpin for Event

§

impl UnwindSafe for Event

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V