pub trait CUDA_NvidiaOpticalFlow_1_0Trait: CUDA_NvidiaHWOpticalFlowTrait + CUDA_NvidiaOpticalFlow_1_0TraitConst {
    // Required method
    fn as_raw_mut_CUDA_NvidiaOpticalFlow_1_0(&mut self) -> *mut c_void;

    // Provided method
    fn up_sampler(
        &mut self,
        flow: &impl ToInputArray,
        image_size: Size,
        grid_size: i32,
        upsampled_flow: &mut impl ToInputOutputArray
    ) -> Result<()> { ... }
}
Expand description

Required Methods§

Provided Methods§

source

fn up_sampler( &mut self, flow: &impl ToInputArray, image_size: Size, grid_size: i32, upsampled_flow: &mut impl ToInputOutputArray ) -> Result<()>

The NVIDIA optical flow hardware generates flow vectors at granularity gridSize, which can be queried via function getGridSize(). Upsampler() helper function converts the hardware-generated flow vectors to dense representation (1 flow vector for each pixel) using nearest neighbour upsampling method.

Parameters
  • flow: Buffer of type CV_16FC2 containing flow vectors generated by calc().
  • imageSize: Size of the input image in pixels for which these flow vectors were generated.
  • gridSize: Granularity of the optical flow vectors returned by calc() function. Can be queried using getGridSize().
  • upsampledFlow: Buffer of type CV_32FC2, containing upsampled flow vectors, each flow vector for 1 pixel, in the pitch-linear layout.

Object Safety§

This trait is not object safe.

Implementors§