pub trait QuasiDenseStereoTrait: QuasiDenseStereoTraitConst {
// Required method
fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void;
// Provided methods
fn set_param(&mut self, val: PropagationParameters) { ... }
fn load_parameters(&mut self, filepath: &str) -> Result<i32> { ... }
fn save_parameters(&mut self, filepath: &str) -> Result<i32> { ... }
fn get_sparse_matches(
&mut self,
s_matches: &mut Vector<MatchQuasiDense>,
) -> Result<()> { ... }
fn get_dense_matches(
&mut self,
dense_matches: &mut Vector<MatchQuasiDense>,
) -> Result<()> { ... }
fn process(
&mut self,
img_left: &impl MatTraitConst,
img_right: &impl MatTraitConst,
) -> Result<()> { ... }
fn get_match(&mut self, x: i32, y: i32) -> Result<Point2f> { ... }
fn get_disparity(&mut self) -> Result<Mat> { ... }
}
Expand description
Mutable methods for crate::stereo::QuasiDenseStereo
Required Methods§
fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void
Provided Methods§
fn set_param(&mut self, val: PropagationParameters)
Sourcefn load_parameters(&mut self, filepath: &str) -> Result<i32>
fn load_parameters(&mut self, filepath: &str) -> Result<i32>
Load a file containing the configuration parameters of the class.
§Parameters
- filepath: The location of the .YAML file containing the configuration parameters.
Note: default value is an empty string in which case the default parameters will be loaded. @retval 1: If the path is not empty and the program loaded the parameters successfully. @retval 0: If the path is empty and the program loaded default parameters. @retval -1: If the file location is not valid or the program could not open the file and loaded default parameters from defaults.hpp.
Note: The method is automatically called in the constructor and configures the class.
Note: Loading different parameters will have an effect on the output. This is useful for tuning in case of video processing.
§See also
loadParameters
Sourcefn save_parameters(&mut self, filepath: &str) -> Result<i32>
fn save_parameters(&mut self, filepath: &str) -> Result<i32>
Save a file containing all the configuration parameters the class is currently set to.
§Parameters
- filepath: The location to store the parameters file.
Note: Calling this method with no arguments will result in storing class parameters to a file names “qds_parameters.yaml” in the root project folder.
Note: This method can be used to generate a template file for tuning the class.
§See also
loadParameters
Sourcefn get_sparse_matches(
&mut self,
s_matches: &mut Vector<MatchQuasiDense>,
) -> Result<()>
fn get_sparse_matches( &mut self, s_matches: &mut Vector<MatchQuasiDense>, ) -> Result<()>
Get The sparse corresponding points.
§Parameters
- sMatches:[out] A vector containing all sparse correspondences.
Note: The method clears the sMatches vector.
Note: The returned Match elements inside the sMatches vector, do not use corr member.
Sourcefn get_dense_matches(
&mut self,
dense_matches: &mut Vector<MatchQuasiDense>,
) -> Result<()>
fn get_dense_matches( &mut self, dense_matches: &mut Vector<MatchQuasiDense>, ) -> Result<()>
Get The dense corresponding points.
§Parameters
- denseMatches:[out] A vector containing all dense matches.
Note: The method clears the denseMatches vector.
Note: The returned Match elements inside the sMatches vector, do not use corr member.
Sourcefn process(
&mut self,
img_left: &impl MatTraitConst,
img_right: &impl MatTraitConst,
) -> Result<()>
fn process( &mut self, img_left: &impl MatTraitConst, img_right: &impl MatTraitConst, ) -> Result<()>
Main process of the algorithm. This method computes the sparse seeds and then densifies them.
Initially input images are converted to gray-scale and then the sparseMatching method is called to obtain the sparse stereo. Finally quasiDenseMatching is called to densify the corresponding points.
§Parameters
- imgLeft: The left Channel of a stereo image pair.
- imgRight: The right Channel of a stereo image pair.
Note: If input images are in color, the method assumes that are BGR and converts them to grayscale.
§See also
sparseMatching quasiDenseMatching
Sourcefn get_match(&mut self, x: i32, y: i32) -> Result<Point2f>
fn get_match(&mut self, x: i32, y: i32) -> Result<Point2f>
Specify pixel coordinates in the left image and get its corresponding location in the right image.
§Parameters
- x: The x pixel coordinate in the left image channel.
- y: The y pixel coordinate in the left image channel. @retval cv::Point(x, y) The location of the corresponding pixel in the right image. @retval cv::Point(0, 0) (NO_MATCH) if no match is found in the right image for the specified pixel location in the left image.
Note: This method should be always called after process, otherwise the matches will not be correct.
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.