realsense_rust/processing_blocks.rs
1//! Processing blocks available to the RealSense library
2//!
3//! Processing blocks are used to apply various filters and transformations to frame data.
4//! Each processing block operates on frames and outputs modified versions.
5//!
6//! ## Available Processing Blocks
7//!
8//! ### Core Processing Blocks
9//! - [`align`] - Aligns frames from different sensors to a common coordinate system
10//! - [`colorizer`] - Converts depth frames to RGB format for visualization
11//! - [`decimation`] - Reduces the resolution of depth frames
12//! - [`pointcloud`] - Generates 3D point clouds from depth data
13//!
14//! ### Filtering Blocks
15//! - [`spatial_filter`] - Performs spatial filtering to smooth depth data
16//! - [`temporal_filter`] - Reduces temporal noise by averaging frames over time
17//! - [`hole_filling`] - Fills holes in depth data using adjacent pixels
18//! - [`threshold`] - Filters depth values based on min/max thresholds
19//!
20//! ### Transform Blocks
21//! - [`disparity_transform`] - Converts between depth and disparity domains
22//!
23//! ### Configuration
24//! - [`options`] - Runtime configuration options for processing blocks
25//!
26//! ## Usage Examples
27//!
28//! ### Basic Colorizer
29//! ```rust,no_run
30//! use realsense_rust::processing_blocks::colorizer::Colorizer;
31//! use std::time::Duration;
32//!
33//! # fn example() -> anyhow::Result<()> {
34//! let mut colorizer = Colorizer::new(5)?;
35//!
36//! // Process a depth frame
37//! # let depth_frame = todo!(); // Get depth frame from pipeline
38//! colorizer.queue(depth_frame)?;
39//! let colorized_frame = colorizer.wait(Duration::from_millis(100))?;
40//! # Ok(())
41//! # }
42//! ```
43//!
44//! ### Filter Chain
45//! ```rust,no_run
46//! use realsense_rust::processing_blocks::{
47//! decimation::Decimation,
48//! spatial_filter::SpatialFilter,
49//! temporal_filter::TemporalFilter,
50//! hole_filling::HoleFillingFilter,
51//! colorizer::Colorizer,
52//! };
53//! use std::time::Duration;
54//!
55//! # fn example() -> anyhow::Result<()> {
56//! // Create filter chain
57//! let mut decimation = Decimation::new(5)?;
58//! let mut spatial_filter = SpatialFilter::new(5)?;
59//! let mut temporal_filter = TemporalFilter::new(5)?;
60//! let mut hole_filling = HoleFillingFilter::new(5)?;
61//! let mut colorizer = Colorizer::new(5)?;
62//!
63//! # let depth_frame = todo!(); // Get depth frame
64//! // Apply filters in sequence
65//! decimation.queue(depth_frame)?;
66//! let frame = decimation.wait(Duration::from_millis(100))?;
67//!
68//! spatial_filter.queue(frame)?;
69//! let frame = spatial_filter.wait(Duration::from_millis(100))?;
70//!
71//! temporal_filter.queue(frame)?;
72//! let frame = temporal_filter.wait(Duration::from_millis(100))?;
73//!
74//! hole_filling.queue(frame)?;
75//! let frame = hole_filling.wait(Duration::from_millis(100))?;
76//!
77//! colorizer.queue(frame)?;
78//! let colorized_frame = colorizer.wait(Duration::from_millis(100))?;
79//! # Ok(())
80//! # }
81//! ```
82//!
83//! See the `examples/` directory for complete working examples.
84
85pub mod align;
86pub mod colorizer;
87pub mod decimation;
88pub mod disparity_transform;
89pub mod errors;
90pub mod hole_filling;
91pub mod options;
92pub mod pointcloud;
93pub mod spatial_filter;
94pub mod temporal_filter;
95pub mod threshold;