[][src]Trait opencv::cudastereo::prelude::CUDA_StereoBeliefPropagation

pub trait CUDA_StereoBeliefPropagation: StereoMatcher {
    pub fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void;
pub fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void; pub fn compute(
        &mut self,
        left: &dyn ToInputArray,
        right: &dyn ToInputArray,
        disparity: &mut dyn ToOutputArray,
        stream: &mut Stream
    ) -> Result<()> { ... }
pub fn compute_1(
        &mut self,
        data: &dyn ToInputArray,
        disparity: &mut dyn ToOutputArray,
        stream: &mut Stream
    ) -> Result<()> { ... }
pub fn get_num_iters(&self) -> Result<i32> { ... }
pub fn set_num_iters(&mut self, iters: i32) -> Result<()> { ... }
pub fn get_num_levels(&self) -> Result<i32> { ... }
pub fn set_num_levels(&mut self, levels: i32) -> Result<()> { ... }
pub fn get_max_data_term(&self) -> Result<f64> { ... }
pub fn set_max_data_term(&mut self, max_data_term: f64) -> Result<()> { ... }
pub fn get_data_weight(&self) -> Result<f64> { ... }
pub fn set_data_weight(&mut self, data_weight: f64) -> Result<()> { ... }
pub fn get_max_disc_term(&self) -> Result<f64> { ... }
pub fn set_max_disc_term(&mut self, max_disc_term: f64) -> Result<()> { ... }
pub fn get_disc_single_jump(&self) -> Result<f64> { ... }
pub fn set_disc_single_jump(&mut self, disc_single_jump: f64) -> Result<()> { ... }
pub fn get_msg_type(&self) -> Result<i32> { ... }
pub fn set_msg_type(&mut self, msg_type: i32) -> Result<()> { ... } }

Class computing stereo correspondence using the belief propagation algorithm. :

The class implements algorithm described in Felzenszwalb2006 . It can compute own data cost (using a truncated linear model) or use a user-provided data cost.

Note: StereoBeliefPropagation requires a lot of memory for message storage:

block formula

and for data cost storage:

block formula

width_step is the number of bytes in a line including padding.

StereoBeliefPropagation uses a truncated linear model for the data cost and discontinuity terms:

block formula

block formula

For more details, see Felzenszwalb2006 .

By default, StereoBeliefPropagation uses floating-point arithmetics and the CV_32FC1 type for messages. But it can also use fixed-point arithmetics and the CV_16SC1 message type for better performance. To avoid an overflow in this case, the parameters must satisfy the following requirement:

block formula

See also

StereoMatcher

Required methods

Loading content...

Provided methods

pub fn compute(
    &mut self,
    left: &dyn ToInputArray,
    right: &dyn ToInputArray,
    disparity: &mut dyn ToOutputArray,
    stream: &mut Stream
) -> Result<()>
[src]

Enables the stereo correspondence operator that finds the disparity for the specified data cost.

Parameters

  • data: User-specified data cost, a matrix of msg_type type and Size(<image columns>*ndisp, <image rows>) size.
  • disparity: Output disparity map. If disparity is empty, the output type is CV_16SC1 . Otherwise, the type is retained. In 16-bit signed format, the disparity values do not have fractional bits.
  • stream: Stream for the asynchronous version.

Overloaded parameters

pub fn compute_1(
    &mut self,
    data: &dyn ToInputArray,
    disparity: &mut dyn ToOutputArray,
    stream: &mut Stream
) -> Result<()>
[src]

Enables the stereo correspondence operator that finds the disparity for the specified data cost.

Parameters

  • data: User-specified data cost, a matrix of msg_type type and Size(<image columns>*ndisp, <image rows>) size.
  • disparity: Output disparity map. If disparity is empty, the output type is CV_16SC1 . Otherwise, the type is retained. In 16-bit signed format, the disparity values do not have fractional bits.
  • stream: Stream for the asynchronous version.

C++ default parameters

  • stream: Stream::Null()

pub fn get_num_iters(&self) -> Result<i32>[src]

number of BP iterations on each level

pub fn set_num_iters(&mut self, iters: i32) -> Result<()>[src]

pub fn get_num_levels(&self) -> Result<i32>[src]

number of levels

pub fn set_num_levels(&mut self, levels: i32) -> Result<()>[src]

pub fn get_max_data_term(&self) -> Result<f64>[src]

truncation of data cost

pub fn set_max_data_term(&mut self, max_data_term: f64) -> Result<()>[src]

pub fn get_data_weight(&self) -> Result<f64>[src]

data weight

pub fn set_data_weight(&mut self, data_weight: f64) -> Result<()>[src]

pub fn get_max_disc_term(&self) -> Result<f64>[src]

truncation of discontinuity cost

pub fn set_max_disc_term(&mut self, max_disc_term: f64) -> Result<()>[src]

pub fn get_disc_single_jump(&self) -> Result<f64>[src]

discontinuity single jump

pub fn set_disc_single_jump(&mut self, disc_single_jump: f64) -> Result<()>[src]

pub fn get_msg_type(&self) -> Result<i32>[src]

type for messages (CV_16SC1 or CV_32FC1)

pub fn set_msg_type(&mut self, msg_type: i32) -> Result<()>[src]

Loading content...

Implementations

impl<'_> dyn CUDA_StereoBeliefPropagation + '_[src]

Uses a heuristic method to compute the recommended parameters ( ndisp, iters and levels ) for the specified image size ( width and height ).

Implementors

Loading content...