Expand description
Processing blocks available to the RealSense library
Processing blocks are used to apply various filters and transformations to frame data. Each processing block operates on frames and outputs modified versions.
§Available Processing Blocks
§Core Processing Blocks
align- Aligns frames from different sensors to a common coordinate systemcolorizer- Converts depth frames to RGB format for visualizationdecimation- Reduces the resolution of depth framespointcloud- Generates 3D point clouds from depth data
§Filtering Blocks
spatial_filter- Performs spatial filtering to smooth depth datatemporal_filter- Reduces temporal noise by averaging frames over timehole_filling- Fills holes in depth data using adjacent pixelsthreshold- Filters depth values based on min/max thresholds
§Transform Blocks
disparity_transform- Converts between depth and disparity domains
§Configuration
options- Runtime configuration options for processing blocks
§Usage Examples
§Basic Colorizer
use realsense_rust::processing_blocks::colorizer::Colorizer;
use std::time::Duration;
let mut colorizer = Colorizer::new(5)?;
// Process a depth frame
colorizer.queue(depth_frame)?;
let colorized_frame = colorizer.wait(Duration::from_millis(100))?;§Filter Chain
use realsense_rust::processing_blocks::{
decimation::Decimation,
spatial_filter::SpatialFilter,
temporal_filter::TemporalFilter,
hole_filling::HoleFillingFilter,
colorizer::Colorizer,
};
use std::time::Duration;
// Create filter chain
let mut decimation = Decimation::new(5)?;
let mut spatial_filter = SpatialFilter::new(5)?;
let mut temporal_filter = TemporalFilter::new(5)?;
let mut hole_filling = HoleFillingFilter::new(5)?;
let mut colorizer = Colorizer::new(5)?;
// Apply filters in sequence
decimation.queue(depth_frame)?;
let frame = decimation.wait(Duration::from_millis(100))?;
spatial_filter.queue(frame)?;
let frame = spatial_filter.wait(Duration::from_millis(100))?;
temporal_filter.queue(frame)?;
let frame = temporal_filter.wait(Duration::from_millis(100))?;
hole_filling.queue(frame)?;
let frame = hole_filling.wait(Duration::from_millis(100))?;
colorizer.queue(frame)?;
let colorized_frame = colorizer.wait(Duration::from_millis(100))?;See the examples/ directory for complete working examples.
Modules§
- align
- Processing block aligning one stream with the other
- colorizer
- Processing block for colorizing depth data
- decimation
- Processing block that decimates the depth stream
- disparity_
transform - Processing block for depth<->disparity domain transformation
- errors
- Errors that can occur when handling processing blocks.
- hole_
filling - Processing block for filling holes in depth data
- options
- Processing block option definitions and management
- pointcloud
- Processing block for generating point clouds from depth data
- spatial_
filter - Processing block for applying spatial filtering to depth data
- temporal_
filter - Processing block for applying temporal filtering to depth data
- threshold
- Processing block for thresholding depth data