pub trait StereoBMTrait: StereoBMTraitConst + StereoMatcherTrait {
// Required method
fn as_raw_mut_StereoBM(&mut self) -> *mut c_void;
// Provided methods
fn set_pre_filter_type(&mut self, pre_filter_type: i32) -> Result<()> { ... }
fn set_pre_filter_size(&mut self, pre_filter_size: i32) -> Result<()> { ... }
fn set_pre_filter_cap(&mut self, pre_filter_cap: i32) -> Result<()> { ... }
fn set_texture_threshold(&mut self, texture_threshold: i32) -> Result<()> { ... }
fn set_uniqueness_ratio(&mut self, uniqueness_ratio: i32) -> Result<()> { ... }
fn set_smaller_block_size(&mut self, block_size: i32) -> Result<()> { ... }
fn set_roi1(&mut self, roi1: Rect) -> Result<()> { ... }
fn set_roi2(&mut self, roi2: Rect) -> Result<()> { ... }
}
Expand description
Mutable methods for crate::calib3d::StereoBM
Required Methods§
fn as_raw_mut_StereoBM(&mut self) -> *mut c_void
Provided Methods§
Sourcefn set_pre_filter_type(&mut self, pre_filter_type: i32) -> Result<()>
fn set_pre_filter_type(&mut self, pre_filter_type: i32) -> Result<()>
Sets the type of pre-filtering used in the algorithm.
§Parameters
- preFilterType: The type of pre-filter to use. Possible values are:
- PREFILTER_NORMALIZED_RESPONSE (0): Uses normalized response for pre-filtering.
- PREFILTER_XSOBEL (1): Uses the X-Sobel operator for pre-filtering. @details The pre-filter type affects how the images are prepared before computing the disparity map. Different pre-filtering methods can enhance specific image features or reduce noise, influencing the quality of the disparity map.
Sourcefn set_pre_filter_size(&mut self, pre_filter_size: i32) -> Result<()>
fn set_pre_filter_size(&mut self, pre_filter_size: i32) -> Result<()>
Sets the size of the pre-filter kernel.
§Parameters
- preFilterSize: The size of the pre-filter kernel. Must be an odd integer, typically between 5 and 255. @details The pre-filter size determines the spatial extent of the pre-filtering operation, which prepares the images for disparity computation by normalizing brightness and enhancing texture. Larger sizes reduce noise but may blur details, while smaller sizes preserve details but are more susceptible to noise.
Sourcefn set_pre_filter_cap(&mut self, pre_filter_cap: i32) -> Result<()>
fn set_pre_filter_cap(&mut self, pre_filter_cap: i32) -> Result<()>
Sets the truncation value for prefiltered pixels.
§Parameters
- preFilterCap: The truncation value. Typically in the range [1, 63]. @details This value caps the output of the pre-filter to [-preFilterCap, preFilterCap], helping to reduce the impact of noise and outliers in the pre-filtered image.
Sourcefn set_texture_threshold(&mut self, texture_threshold: i32) -> Result<()>
fn set_texture_threshold(&mut self, texture_threshold: i32) -> Result<()>
Sets the threshold for filtering low-texture regions.
§Parameters
- textureThreshold: The threshold value. Must be non-negative. @details This parameter filters out regions with low texture, where establishing correspondences is difficult, thus reducing noise in the disparity map. Higher values filter more aggressively but may discard valid information.
Sourcefn set_uniqueness_ratio(&mut self, uniqueness_ratio: i32) -> Result<()>
fn set_uniqueness_ratio(&mut self, uniqueness_ratio: i32) -> Result<()>
Sets the uniqueness ratio for filtering ambiguous matches.
§Parameters
- uniquenessRatio: The uniqueness ratio value. Typically in the range [5, 15], but can be from 0 to 100. @details This parameter ensures that the best match is sufficiently better than the next best match, reducing false positives. Higher values are stricter but may filter out valid matches in difficult regions.
Sourcefn set_smaller_block_size(&mut self, block_size: i32) -> Result<()>
fn set_smaller_block_size(&mut self, block_size: i32) -> Result<()>
Sets the size of the smaller block used for texture check.
§Parameters
- blockSize: The size of the smaller block. Must be an odd integer between 5 and 255. @details This parameter determines the size of the block used to compute texture variance. Smaller blocks capture finer details but are more sensitive to noise, while larger blocks are more robust but may miss fine details.
Sourcefn set_roi1(&mut self, roi1: Rect) -> Result<()>
fn set_roi1(&mut self, roi1: Rect) -> Result<()>
Sets the Region of Interest (ROI) for the left image.
§Parameters
- roi1: The ROI rectangle for the left image. @details By setting the ROI, the stereo matching computation is limited to the specified region, improving performance and potentially accuracy by focusing on relevant parts of the image.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.