#![allow(
unused_parens,
clippy::excessive_precision,
clippy::missing_safety_doc,
clippy::not_unsafe_ptr_arg_deref,
clippy::should_implement_trait,
clippy::too_many_arguments,
clippy::unused_unit,
)]
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
pub use { super::CUDA_DenseOpticalFlow, super::CUDA_SparseOpticalFlow, super::CUDA_NvidiaHWOpticalFlow, super::CUDA_BroxOpticalFlow, super::CUDA_SparsePyrLKOpticalFlow, super::CUDA_DensePyrLKOpticalFlow, super::CUDA_FarnebackOpticalFlow, super::CUDA_OpticalFlowDual_TVL1, super::CUDA_NvidiaOpticalFlow_1_0, super::CUDA_NvidiaOpticalFlow_2_0 };
}
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum CUDA_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL {
NV_OF_PERF_LEVEL_UNDEFINED = 0,
NV_OF_PERF_LEVEL_SLOW = 5,
NV_OF_PERF_LEVEL_MEDIUM = 10,
NV_OF_PERF_LEVEL_FAST = 20,
NV_OF_PERF_LEVEL_MAX = 21,
}
opencv_type_enum! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE {
NV_OF_HINT_VECTOR_GRID_SIZE_UNDEFINED = 0,
NV_OF_HINT_VECTOR_GRID_SIZE_1 = 1,
NV_OF_HINT_VECTOR_GRID_SIZE_2 = 2,
NV_OF_HINT_VECTOR_GRID_SIZE_4 = 4,
NV_OF_HINT_VECTOR_GRID_SIZE_8 = 8,
NV_OF_HINT_VECTOR_GRID_SIZE_MAX = 9,
}
opencv_type_enum! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE {
NV_OF_OUTPUT_VECTOR_GRID_SIZE_UNDEFINED = 0,
NV_OF_OUTPUT_VECTOR_GRID_SIZE_1 = 1,
NV_OF_OUTPUT_VECTOR_GRID_SIZE_2 = 2,
NV_OF_OUTPUT_VECTOR_GRID_SIZE_4 = 4,
NV_OF_OUTPUT_VECTOR_GRID_SIZE_MAX = 5,
}
opencv_type_enum! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL {
NV_OF_PERF_LEVEL_UNDEFINED = 0,
NV_OF_PERF_LEVEL_SLOW = 5,
NV_OF_PERF_LEVEL_MEDIUM = 10,
NV_OF_PERF_LEVEL_FAST = 20,
NV_OF_PERF_LEVEL_MAX = 21,
}
opencv_type_enum! { crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL }
pub trait CUDA_BroxOpticalFlow: crate::cudaoptflow::CUDA_DenseOpticalFlow {
fn as_raw_CUDA_BroxOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_BroxOpticalFlow(&mut self) -> *mut c_void;
fn get_flow_smoothness(&self) -> Result<f64> {
unsafe { sys::cv_cuda_BroxOpticalFlow_getFlowSmoothness_const(self.as_raw_CUDA_BroxOpticalFlow()) }.into_result()
}
fn set_flow_smoothness(&mut self, alpha: f64) -> Result<()> {
unsafe { sys::cv_cuda_BroxOpticalFlow_setFlowSmoothness_double(self.as_raw_mut_CUDA_BroxOpticalFlow(), alpha) }.into_result()
}
fn get_gradient_constancy_importance(&self) -> Result<f64> {
unsafe { sys::cv_cuda_BroxOpticalFlow_getGradientConstancyImportance_const(self.as_raw_CUDA_BroxOpticalFlow()) }.into_result()
}
fn set_gradient_constancy_importance(&mut self, gamma: f64) -> Result<()> {
unsafe { sys::cv_cuda_BroxOpticalFlow_setGradientConstancyImportance_double(self.as_raw_mut_CUDA_BroxOpticalFlow(), gamma) }.into_result()
}
fn get_pyramid_scale_factor(&self) -> Result<f64> {
unsafe { sys::cv_cuda_BroxOpticalFlow_getPyramidScaleFactor_const(self.as_raw_CUDA_BroxOpticalFlow()) }.into_result()
}
fn set_pyramid_scale_factor(&mut self, scale_factor: f64) -> Result<()> {
unsafe { sys::cv_cuda_BroxOpticalFlow_setPyramidScaleFactor_double(self.as_raw_mut_CUDA_BroxOpticalFlow(), scale_factor) }.into_result()
}
fn get_inner_iterations(&self) -> Result<i32> {
unsafe { sys::cv_cuda_BroxOpticalFlow_getInnerIterations_const(self.as_raw_CUDA_BroxOpticalFlow()) }.into_result()
}
fn set_inner_iterations(&mut self, inner_iterations: i32) -> Result<()> {
unsafe { sys::cv_cuda_BroxOpticalFlow_setInnerIterations_int(self.as_raw_mut_CUDA_BroxOpticalFlow(), inner_iterations) }.into_result()
}
fn get_outer_iterations(&self) -> Result<i32> {
unsafe { sys::cv_cuda_BroxOpticalFlow_getOuterIterations_const(self.as_raw_CUDA_BroxOpticalFlow()) }.into_result()
}
fn set_outer_iterations(&mut self, outer_iterations: i32) -> Result<()> {
unsafe { sys::cv_cuda_BroxOpticalFlow_setOuterIterations_int(self.as_raw_mut_CUDA_BroxOpticalFlow(), outer_iterations) }.into_result()
}
fn get_solver_iterations(&self) -> Result<i32> {
unsafe { sys::cv_cuda_BroxOpticalFlow_getSolverIterations_const(self.as_raw_CUDA_BroxOpticalFlow()) }.into_result()
}
fn set_solver_iterations(&mut self, solver_iterations: i32) -> Result<()> {
unsafe { sys::cv_cuda_BroxOpticalFlow_setSolverIterations_int(self.as_raw_mut_CUDA_BroxOpticalFlow(), solver_iterations) }.into_result()
}
}
impl dyn CUDA_BroxOpticalFlow + '_ {
pub fn create(alpha: f64, gamma: f64, scale_factor: f64, inner_iterations: i32, outer_iterations: i32, solver_iterations: i32) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_BroxOpticalFlow>> {
unsafe { sys::cv_cuda_BroxOpticalFlow_create_double_double_double_int_int_int(alpha, gamma, scale_factor, inner_iterations, outer_iterations, solver_iterations) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_BroxOpticalFlow>::opencv_from_extern(r) } )
}
}
pub trait CUDA_DenseOpticalFlow: core::AlgorithmTrait {
fn as_raw_CUDA_DenseOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_DenseOpticalFlow(&mut self) -> *mut c_void;
fn calc(&mut self, i0: &dyn core::ToInputArray, i1: &dyn core::ToInputArray, flow: &mut dyn core::ToInputOutputArray, stream: &mut core::Stream) -> Result<()> {
input_array_arg!(i0);
input_array_arg!(i1);
input_output_array_arg!(flow);
unsafe { sys::cv_cuda_DenseOpticalFlow_calc_const__InputArrayR_const__InputArrayR_const__InputOutputArrayR_StreamR(self.as_raw_mut_CUDA_DenseOpticalFlow(), i0.as_raw__InputArray(), i1.as_raw__InputArray(), flow.as_raw__InputOutputArray(), stream.as_raw_mut_Stream()) }.into_result()
}
}
pub trait CUDA_DensePyrLKOpticalFlow: crate::cudaoptflow::CUDA_DenseOpticalFlow {
fn as_raw_CUDA_DensePyrLKOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_DensePyrLKOpticalFlow(&mut self) -> *mut c_void;
fn get_win_size(&self) -> Result<core::Size> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_getWinSize_const(self.as_raw_CUDA_DensePyrLKOpticalFlow()) }.into_result()
}
fn set_win_size(&mut self, win_size: core::Size) -> Result<()> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_setWinSize_Size(self.as_raw_mut_CUDA_DensePyrLKOpticalFlow(), win_size.opencv_as_extern()) }.into_result()
}
fn get_max_level(&self) -> Result<i32> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_getMaxLevel_const(self.as_raw_CUDA_DensePyrLKOpticalFlow()) }.into_result()
}
fn set_max_level(&mut self, max_level: i32) -> Result<()> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_setMaxLevel_int(self.as_raw_mut_CUDA_DensePyrLKOpticalFlow(), max_level) }.into_result()
}
fn get_num_iters(&self) -> Result<i32> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_getNumIters_const(self.as_raw_CUDA_DensePyrLKOpticalFlow()) }.into_result()
}
fn set_num_iters(&mut self, iters: i32) -> Result<()> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_setNumIters_int(self.as_raw_mut_CUDA_DensePyrLKOpticalFlow(), iters) }.into_result()
}
fn get_use_initial_flow(&self) -> Result<bool> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_getUseInitialFlow_const(self.as_raw_CUDA_DensePyrLKOpticalFlow()) }.into_result()
}
fn set_use_initial_flow(&mut self, use_initial_flow: bool) -> Result<()> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_setUseInitialFlow_bool(self.as_raw_mut_CUDA_DensePyrLKOpticalFlow(), use_initial_flow) }.into_result()
}
}
impl dyn CUDA_DensePyrLKOpticalFlow + '_ {
pub fn create(win_size: core::Size, max_level: i32, iters: i32, use_initial_flow: bool) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow>> {
unsafe { sys::cv_cuda_DensePyrLKOpticalFlow_create_Size_int_int_bool(win_size.opencv_as_extern(), max_level, iters, use_initial_flow) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_DensePyrLKOpticalFlow>::opencv_from_extern(r) } )
}
}
pub trait CUDA_FarnebackOpticalFlow: crate::cudaoptflow::CUDA_DenseOpticalFlow {
fn as_raw_CUDA_FarnebackOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_FarnebackOpticalFlow(&mut self) -> *mut c_void;
fn get_num_levels(&self) -> Result<i32> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getNumLevels_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_num_levels(&mut self, num_levels: i32) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setNumLevels_int(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), num_levels) }.into_result()
}
fn get_pyr_scale(&self) -> Result<f64> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getPyrScale_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_pyr_scale(&mut self, pyr_scale: f64) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setPyrScale_double(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), pyr_scale) }.into_result()
}
fn get_fast_pyramids(&self) -> Result<bool> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getFastPyramids_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_fast_pyramids(&mut self, fast_pyramids: bool) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setFastPyramids_bool(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), fast_pyramids) }.into_result()
}
fn get_win_size(&self) -> Result<i32> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getWinSize_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_win_size(&mut self, win_size: i32) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setWinSize_int(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), win_size) }.into_result()
}
fn get_num_iters(&self) -> Result<i32> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getNumIters_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_num_iters(&mut self, num_iters: i32) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setNumIters_int(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), num_iters) }.into_result()
}
fn get_poly_n(&self) -> Result<i32> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getPolyN_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_poly_n(&mut self, poly_n: i32) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setPolyN_int(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), poly_n) }.into_result()
}
fn get_poly_sigma(&self) -> Result<f64> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getPolySigma_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_poly_sigma(&mut self, poly_sigma: f64) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setPolySigma_double(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), poly_sigma) }.into_result()
}
fn get_flags(&self) -> Result<i32> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_getFlags_const(self.as_raw_CUDA_FarnebackOpticalFlow()) }.into_result()
}
fn set_flags(&mut self, flags: i32) -> Result<()> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_setFlags_int(self.as_raw_mut_CUDA_FarnebackOpticalFlow(), flags) }.into_result()
}
}
impl dyn CUDA_FarnebackOpticalFlow + '_ {
pub fn create(num_levels: i32, pyr_scale: f64, fast_pyramids: bool, win_size: i32, num_iters: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_FarnebackOpticalFlow>> {
unsafe { sys::cv_cuda_FarnebackOpticalFlow_create_int_double_bool_int_int_int_double_int(num_levels, pyr_scale, fast_pyramids, win_size, num_iters, poly_n, poly_sigma, flags) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_FarnebackOpticalFlow>::opencv_from_extern(r) } )
}
}
pub trait CUDA_NvidiaHWOpticalFlow: core::AlgorithmTrait {
fn as_raw_CUDA_NvidiaHWOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_NvidiaHWOpticalFlow(&mut self) -> *mut c_void;
fn calc(&mut self, input_image: &dyn core::ToInputArray, reference_image: &dyn core::ToInputArray, flow: &mut dyn core::ToInputOutputArray, stream: &mut core::Stream, hint: &dyn core::ToInputArray, cost: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(input_image);
input_array_arg!(reference_image);
input_output_array_arg!(flow);
input_array_arg!(hint);
output_array_arg!(cost);
unsafe { sys::cv_cuda_NvidiaHWOpticalFlow_calc_const__InputArrayR_const__InputArrayR_const__InputOutputArrayR_StreamR_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_CUDA_NvidiaHWOpticalFlow(), input_image.as_raw__InputArray(), reference_image.as_raw__InputArray(), flow.as_raw__InputOutputArray(), stream.as_raw_mut_Stream(), hint.as_raw__InputArray(), cost.as_raw__OutputArray()) }.into_result()
}
fn collect_garbage(&mut self) -> Result<()> {
unsafe { sys::cv_cuda_NvidiaHWOpticalFlow_collectGarbage(self.as_raw_mut_CUDA_NvidiaHWOpticalFlow()) }.into_result()
}
fn get_grid_size(&self) -> Result<i32> {
unsafe { sys::cv_cuda_NvidiaHWOpticalFlow_getGridSize_const(self.as_raw_CUDA_NvidiaHWOpticalFlow()) }.into_result()
}
}
pub trait CUDA_NvidiaOpticalFlow_1_0: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow {
fn as_raw_CUDA_NvidiaOpticalFlow_1_0(&self) -> *const c_void;
fn as_raw_mut_CUDA_NvidiaOpticalFlow_1_0(&mut self) -> *mut c_void;
fn up_sampler(&mut self, flow: &dyn core::ToInputArray, image_size: core::Size, grid_size: i32, upsampled_flow: &mut dyn core::ToInputOutputArray) -> Result<()> {
input_array_arg!(flow);
input_output_array_arg!(upsampled_flow);
unsafe { sys::cv_cuda_NvidiaOpticalFlow_1_0_upSampler_const__InputArrayR_Size_int_const__InputOutputArrayR(self.as_raw_mut_CUDA_NvidiaOpticalFlow_1_0(), flow.as_raw__InputArray(), image_size.opencv_as_extern(), grid_size, upsampled_flow.as_raw__InputOutputArray()) }.into_result()
}
}
impl dyn CUDA_NvidiaOpticalFlow_1_0 + '_ {
pub fn create(image_size: core::Size, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0_NVIDIA_OF_PERF_LEVEL, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0>> {
unsafe { sys::cv_cuda_NvidiaOpticalFlow_1_0_create_Size_NVIDIA_OF_PERF_LEVEL_bool_bool_bool_int_StreamR_StreamR(image_size.opencv_as_extern(), perf_preset, enable_temporal_hints, enable_external_hints, enable_cost_buffer, gpu_id, input_stream.as_raw_mut_Stream(), output_stream.as_raw_mut_Stream()) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_1_0>::opencv_from_extern(r) } )
}
}
pub trait CUDA_NvidiaOpticalFlow_2_0: crate::cudaoptflow::CUDA_NvidiaHWOpticalFlow {
fn as_raw_CUDA_NvidiaOpticalFlow_2_0(&self) -> *const c_void;
fn as_raw_mut_CUDA_NvidiaOpticalFlow_2_0(&mut self) -> *mut c_void;
fn convert_to_float(&mut self, flow: &dyn core::ToInputArray, float_flow: &mut dyn core::ToInputOutputArray) -> Result<()> {
input_array_arg!(flow);
input_output_array_arg!(float_flow);
unsafe { sys::cv_cuda_NvidiaOpticalFlow_2_0_convertToFloat_const__InputArrayR_const__InputOutputArrayR(self.as_raw_mut_CUDA_NvidiaOpticalFlow_2_0(), flow.as_raw__InputArray(), float_flow.as_raw__InputOutputArray()) }.into_result()
}
}
impl dyn CUDA_NvidiaOpticalFlow_2_0 + '_ {
pub fn create(image_size: core::Size, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL, output_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE, hint_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0>> {
unsafe { sys::cv_cuda_NvidiaOpticalFlow_2_0_create_Size_NVIDIA_OF_PERF_LEVEL_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE_NVIDIA_OF_HINT_VECTOR_GRID_SIZE_bool_bool_bool_int_StreamR_StreamR(image_size.opencv_as_extern(), perf_preset, output_grid_size, hint_grid_size, enable_temporal_hints, enable_external_hints, enable_cost_buffer, gpu_id, input_stream.as_raw_mut_Stream(), output_stream.as_raw_mut_Stream()) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0>::opencv_from_extern(r) } )
}
pub fn create_1(image_size: core::Size, mut roi_data: core::Vector::<core::Rect>, perf_preset: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_PERF_LEVEL, output_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE, hint_grid_size: crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0_NVIDIA_OF_HINT_VECTOR_GRID_SIZE, enable_temporal_hints: bool, enable_external_hints: bool, enable_cost_buffer: bool, gpu_id: i32, input_stream: &mut core::Stream, output_stream: &mut core::Stream) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0>> {
unsafe { sys::cv_cuda_NvidiaOpticalFlow_2_0_create_Size_vector_Rect__NVIDIA_OF_PERF_LEVEL_NVIDIA_OF_OUTPUT_VECTOR_GRID_SIZE_NVIDIA_OF_HINT_VECTOR_GRID_SIZE_bool_bool_bool_int_StreamR_StreamR(image_size.opencv_as_extern(), roi_data.as_raw_mut_VectorOfRect(), perf_preset, output_grid_size, hint_grid_size, enable_temporal_hints, enable_external_hints, enable_cost_buffer, gpu_id, input_stream.as_raw_mut_Stream(), output_stream.as_raw_mut_Stream()) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_NvidiaOpticalFlow_2_0>::opencv_from_extern(r) } )
}
}
pub trait CUDA_OpticalFlowDual_TVL1: crate::cudaoptflow::CUDA_DenseOpticalFlow {
fn as_raw_CUDA_OpticalFlowDual_TVL1(&self) -> *const c_void;
fn as_raw_mut_CUDA_OpticalFlowDual_TVL1(&mut self) -> *mut c_void;
fn get_tau(&self) -> Result<f64> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getTau_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_tau(&mut self, tau: f64) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setTau_double(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), tau) }.into_result()
}
fn get_lambda(&self) -> Result<f64> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getLambda_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_lambda(&mut self, lambda: f64) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setLambda_double(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), lambda) }.into_result()
}
fn get_gamma(&self) -> Result<f64> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getGamma_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_gamma(&mut self, gamma: f64) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setGamma_double(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), gamma) }.into_result()
}
fn get_theta(&self) -> Result<f64> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getTheta_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_theta(&mut self, theta: f64) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setTheta_double(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), theta) }.into_result()
}
fn get_num_scales(&self) -> Result<i32> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getNumScales_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_num_scales(&mut self, nscales: i32) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setNumScales_int(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), nscales) }.into_result()
}
fn get_num_warps(&self) -> Result<i32> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getNumWarps_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_num_warps(&mut self, warps: i32) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setNumWarps_int(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), warps) }.into_result()
}
fn get_epsilon(&self) -> Result<f64> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getEpsilon_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_epsilon(&mut self, epsilon: f64) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setEpsilon_double(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), epsilon) }.into_result()
}
fn get_num_iterations(&self) -> Result<i32> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getNumIterations_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_num_iterations(&mut self, iterations: i32) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setNumIterations_int(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), iterations) }.into_result()
}
fn get_scale_step(&self) -> Result<f64> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getScaleStep_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_scale_step(&mut self, scale_step: f64) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setScaleStep_double(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), scale_step) }.into_result()
}
fn get_use_initial_flow(&self) -> Result<bool> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_getUseInitialFlow_const(self.as_raw_CUDA_OpticalFlowDual_TVL1()) }.into_result()
}
fn set_use_initial_flow(&mut self, use_initial_flow: bool) -> Result<()> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_setUseInitialFlow_bool(self.as_raw_mut_CUDA_OpticalFlowDual_TVL1(), use_initial_flow) }.into_result()
}
}
impl dyn CUDA_OpticalFlowDual_TVL1 + '_ {
pub fn create(tau: f64, lambda: f64, theta: f64, nscales: i32, warps: i32, epsilon: f64, iterations: i32, scale_step: f64, gamma: f64, use_initial_flow: bool) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1>> {
unsafe { sys::cv_cuda_OpticalFlowDual_TVL1_create_double_double_double_int_int_double_int_double_double_bool(tau, lambda, theta, nscales, warps, epsilon, iterations, scale_step, gamma, use_initial_flow) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_OpticalFlowDual_TVL1>::opencv_from_extern(r) } )
}
}
pub trait CUDA_SparseOpticalFlow: core::AlgorithmTrait {
fn as_raw_CUDA_SparseOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_SparseOpticalFlow(&mut self) -> *mut c_void;
fn calc(&mut self, prev_img: &dyn core::ToInputArray, next_img: &dyn core::ToInputArray, prev_pts: &dyn core::ToInputArray, next_pts: &mut dyn core::ToInputOutputArray, status: &mut dyn core::ToOutputArray, err: &mut dyn core::ToOutputArray, stream: &mut core::Stream) -> Result<()> {
input_array_arg!(prev_img);
input_array_arg!(next_img);
input_array_arg!(prev_pts);
input_output_array_arg!(next_pts);
output_array_arg!(status);
output_array_arg!(err);
unsafe { sys::cv_cuda_SparseOpticalFlow_calc_const__InputArrayR_const__InputArrayR_const__InputArrayR_const__InputOutputArrayR_const__OutputArrayR_const__OutputArrayR_StreamR(self.as_raw_mut_CUDA_SparseOpticalFlow(), prev_img.as_raw__InputArray(), next_img.as_raw__InputArray(), prev_pts.as_raw__InputArray(), next_pts.as_raw__InputOutputArray(), status.as_raw__OutputArray(), err.as_raw__OutputArray(), stream.as_raw_mut_Stream()) }.into_result()
}
}
pub trait CUDA_SparsePyrLKOpticalFlow: crate::cudaoptflow::CUDA_SparseOpticalFlow {
fn as_raw_CUDA_SparsePyrLKOpticalFlow(&self) -> *const c_void;
fn as_raw_mut_CUDA_SparsePyrLKOpticalFlow(&mut self) -> *mut c_void;
fn get_win_size(&self) -> Result<core::Size> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_getWinSize_const(self.as_raw_CUDA_SparsePyrLKOpticalFlow()) }.into_result()
}
fn set_win_size(&mut self, win_size: core::Size) -> Result<()> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_setWinSize_Size(self.as_raw_mut_CUDA_SparsePyrLKOpticalFlow(), win_size.opencv_as_extern()) }.into_result()
}
fn get_max_level(&self) -> Result<i32> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_getMaxLevel_const(self.as_raw_CUDA_SparsePyrLKOpticalFlow()) }.into_result()
}
fn set_max_level(&mut self, max_level: i32) -> Result<()> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_setMaxLevel_int(self.as_raw_mut_CUDA_SparsePyrLKOpticalFlow(), max_level) }.into_result()
}
fn get_num_iters(&self) -> Result<i32> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_getNumIters_const(self.as_raw_CUDA_SparsePyrLKOpticalFlow()) }.into_result()
}
fn set_num_iters(&mut self, iters: i32) -> Result<()> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_setNumIters_int(self.as_raw_mut_CUDA_SparsePyrLKOpticalFlow(), iters) }.into_result()
}
fn get_use_initial_flow(&self) -> Result<bool> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_getUseInitialFlow_const(self.as_raw_CUDA_SparsePyrLKOpticalFlow()) }.into_result()
}
fn set_use_initial_flow(&mut self, use_initial_flow: bool) -> Result<()> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_setUseInitialFlow_bool(self.as_raw_mut_CUDA_SparsePyrLKOpticalFlow(), use_initial_flow) }.into_result()
}
}
impl dyn CUDA_SparsePyrLKOpticalFlow + '_ {
pub fn create(win_size: core::Size, max_level: i32, iters: i32, use_initial_flow: bool) -> Result<core::Ptr::<dyn crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow>> {
unsafe { sys::cv_cuda_SparsePyrLKOpticalFlow_create_Size_int_int_bool(win_size.opencv_as_extern(), max_level, iters, use_initial_flow) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::cudaoptflow::CUDA_SparsePyrLKOpticalFlow>::opencv_from_extern(r) } )
}
}