Struct opencv::stereo::QuasiDenseStereo

source ·
pub struct QuasiDenseStereo { /* private fields */ }
Expand description

Class containing the methods needed for Quasi Dense Stereo computation.

This module contains the code to perform quasi dense stereo matching. The method initially starts with a sparse 3D reconstruction based on feature matching across a stereo image pair and subsequently propagates the structure into neighboring image regions. To obtain initial seed correspondences, the algorithm locates Shi and Tomashi features in the left image of the stereo pair and then tracks them using pyramidal Lucas-Kanade in the right image. To densify the sparse correspondences, the algorithm computes the zero-mean normalized cross-correlation (ZNCC) in small patches around every seed pair and uses it as a quality metric for each match. In this code, we introduce a custom structure to store the location and ZNCC value of correspondences called “Match”. Seed Matches are stored in a priority queue sorted according to their ZNCC value, allowing for the best quality Match to be readily available. The algorithm pops Matches and uses them to extract new matches around them. This is done by considering a small neighboring area around each Seed and retrieving correspondences above a certain texture threshold that are not previously computed. New matches are stored in the seed priority queue and used as seeds. The propagation process ends when no additional matches can be retrieved.

§See also

This code represents the work presented in Stoyanov2010. If this code is useful for your work please cite Stoyanov2010.

Also the original growing scheme idea is described in Lhuillier2000

Implementations§

source§

impl QuasiDenseStereo

source

pub fn create( mono_img_size: Size, param_filepath: &str ) -> Result<Ptr<QuasiDenseStereo>>

§C++ default parameters
  • param_filepath: cv::String()
source

pub fn create_def(mono_img_size: Size) -> Result<Ptr<QuasiDenseStereo>>

§Note

This alternative version of QuasiDenseStereo::create function uses the following default values for its arguments:

  • param_filepath: cv::String()

Trait Implementations§

source§

impl Boxed for QuasiDenseStereo

source§

unsafe fn from_raw( ptr: <QuasiDenseStereo as OpenCVFromExtern>::ExternReceive ) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw( self ) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSend

Return the underlying raw pointer. Read more
source§

fn as_raw_mut( &mut self ) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSendMut

Return the underlying mutable raw pointer Read more
source§

impl Debug for QuasiDenseStereo

source§

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

Formats the value using the given formatter. Read more
source§

impl Drop for QuasiDenseStereo

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl QuasiDenseStereoTrait for QuasiDenseStereo

source§

fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void

source§

fn set_param(&mut self, val: PropagationParameters)

source§

fn load_parameters(&mut self, filepath: &str) -> Result<i32>

Load a file containing the configuration parameters of the class. Read more
source§

fn save_parameters(&mut self, filepath: &str) -> Result<i32>

Save a file containing all the configuration parameters the class is currently set to. Read more
source§

fn get_sparse_matches( &mut self, s_matches: &mut Vector<MatchQuasiDense> ) -> Result<()>

Get The sparse corresponding points. Read more
source§

fn get_dense_matches( &mut self, dense_matches: &mut Vector<MatchQuasiDense> ) -> Result<()>

Get The dense corresponding points. Read more
source§

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. Read more
source§

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. Read more
source§

fn get_disparity(&mut self) -> Result<Mat>

Compute and return the disparity map based on the correspondences found in the “process” method. Read more
source§

impl QuasiDenseStereoTraitConst for QuasiDenseStereo

source§

impl Send for QuasiDenseStereo

Auto Trait Implementations§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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<Mat> ModifyInplace for Mat
where Mat: Boxed,

source§

unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res

Helper function to call OpenCV functions that allow in-place modification of a Mat or another similar object. By passing a mutable reference to the Mat to this function your closure will get called with the read reference and a write references to the same Mat. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.