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
impl QuasiDenseStereo
sourcepub fn create(
mono_img_size: Size,
param_filepath: &str
) -> Result<Ptr<QuasiDenseStereo>>
pub fn create( mono_img_size: Size, param_filepath: &str ) -> Result<Ptr<QuasiDenseStereo>>
§C++ default parameters
- param_filepath: cv::String()
sourcepub fn create_def(mono_img_size: Size) -> Result<Ptr<QuasiDenseStereo>>
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
impl Boxed for QuasiDenseStereo
source§unsafe fn from_raw(
ptr: <QuasiDenseStereo as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <QuasiDenseStereo as OpenCVFromExtern>::ExternReceive ) -> Self
source§fn into_raw(
self
) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self ) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self
) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <QuasiDenseStereo as OpenCVTypeExternContainer>::ExternSendMut
source§impl Debug for QuasiDenseStereo
impl Debug for QuasiDenseStereo
source§impl Drop for QuasiDenseStereo
impl Drop for QuasiDenseStereo
source§impl QuasiDenseStereoTrait for QuasiDenseStereo
impl QuasiDenseStereoTrait for QuasiDenseStereo
fn as_raw_mut_QuasiDenseStereo(&mut self) -> *mut c_void
fn set_param(&mut self, val: PropagationParameters)
source§fn load_parameters(&mut self, filepath: &str) -> Result<i32>
fn load_parameters(&mut self, filepath: &str) -> Result<i32>
source§fn save_parameters(&mut self, filepath: &str) -> Result<i32>
fn save_parameters(&mut self, filepath: &str) -> Result<i32>
source§fn get_sparse_matches(
&mut self,
s_matches: &mut Vector<MatchQuasiDense>
) -> Result<()>
fn get_sparse_matches( &mut self, s_matches: &mut Vector<MatchQuasiDense> ) -> Result<()>
source§fn get_dense_matches(
&mut self,
dense_matches: &mut Vector<MatchQuasiDense>
) -> Result<()>
fn get_dense_matches( &mut self, dense_matches: &mut Vector<MatchQuasiDense> ) -> Result<()>
source§fn 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<()>
source§impl QuasiDenseStereoTraitConst for QuasiDenseStereo
impl QuasiDenseStereoTraitConst for QuasiDenseStereo
fn as_raw_QuasiDenseStereo(&self) -> *const c_void
fn param(&self) -> PropagationParameters
impl Send for QuasiDenseStereo
Auto Trait Implementations§
impl Freeze for QuasiDenseStereo
impl RefUnwindSafe for QuasiDenseStereo
impl !Sync for QuasiDenseStereo
impl Unpin for QuasiDenseStereo
impl UnwindSafe for QuasiDenseStereo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
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