[−][src]Trait opencv::prelude::CUDA_StereoBeliefPropagation
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:
and for data cost storage:
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:
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:
See also
StereoMatcher
Required methods
pub fn as_raw_CUDA_StereoBeliefPropagation(&self) -> *const c_void
[src]
pub fn as_raw_mut_CUDA_StereoBeliefPropagation(&mut self) -> *mut c_void
[src]
Provided methods
pub fn compute(
&mut self,
left: &dyn ToInputArray,
right: &dyn ToInputArray,
disparity: &mut dyn ToOutputArray,
stream: &mut Stream
) -> Result<()>
[src]
&mut self,
left: &dyn ToInputArray,
right: &dyn ToInputArray,
disparity: &mut dyn ToOutputArray,
stream: &mut Stream
) -> Result<()>
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]
&mut self,
data: &dyn ToInputArray,
disparity: &mut dyn ToOutputArray,
stream: &mut Stream
) -> Result<()>
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]
Implementations
impl<'_> dyn CUDA_StereoBeliefPropagation + '_
[src]
pub fn estimate_recommended_params(
width: i32,
height: i32,
ndisp: &mut i32,
iters: &mut i32,
levels: &mut i32
) -> Result<()>
[src]
width: i32,
height: i32,
ndisp: &mut i32,
iters: &mut i32,
levels: &mut i32
) -> Result<()>
Uses a heuristic method to compute the recommended parameters ( ndisp, iters and levels ) for the specified image size ( width and height ).