[][src]Trait opencv::rgbd::Kinfu_KinFu

pub trait Kinfu_KinFu {
    pub fn as_raw_Kinfu_KinFu(&self) -> *const c_void;
pub fn as_raw_mut_Kinfu_KinFu(&mut self) -> *mut c_void; pub fn get_params(&self) -> Result<Kinfu_Params> { ... }
pub fn render(
        &self,
        image: &mut dyn ToOutputArray,
        camera_pose: Matx44f
    ) -> Result<()> { ... }
pub fn get_cloud(
        &self,
        points: &mut dyn ToOutputArray,
        normals: &mut dyn ToOutputArray
    ) -> Result<()> { ... }
pub fn get_points(&self, points: &mut dyn ToOutputArray) -> Result<()> { ... }
pub fn get_normals(
        &self,
        points: &dyn ToInputArray,
        normals: &mut dyn ToOutputArray
    ) -> Result<()> { ... }
pub fn reset(&mut self) -> Result<()> { ... }
pub fn get_pose(&self) -> Result<Affine3f> { ... }
pub fn update(&mut self, depth: &dyn ToInputArray) -> Result<bool> { ... } }

KinectFusion implementation

This class implements a 3d reconstruction algorithm described in kinectfusion paper.

It takes a sequence of depth images taken from depth sensor (or any depth images source such as stereo camera matching algorithm or even raymarching renderer). The output can be obtained as a vector of points and their normals or can be Phong-rendered from given camera pose.

An internal representation of a model is a voxel cuboid that keeps TSDF values which are a sort of distances to the surface (for details read the kinectfusion article about TSDF). There is no interface to that representation yet.

KinFu uses OpenCL acceleration automatically if available. To enable or disable it explicitly use cv::setUseOptimized() or cv::ocl::setUseOpenCL().

This implementation is based on kinfu-remake.

Note that the KinectFusion algorithm was patented and its use may be restricted by the list of patents mentioned in README.md file in this module directory.

That's why you need to set the OPENCV_ENABLE_NONFREE option in CMake to use KinectFusion.

Required methods

Loading content...

Provided methods

pub fn get_params(&self) -> Result<Kinfu_Params>[src]

Get current parameters

pub fn render(
    &self,
    image: &mut dyn ToOutputArray,
    camera_pose: Matx44f
) -> Result<()>
[src]

Renders a volume into an image

Renders a 0-surface of TSDF using Phong shading into a CV_8UC4 Mat. Light pose is fixed in KinFu params.

Parameters

  • image: resulting image
  • cameraPose: pose of camera to render from. If empty then render from current pose which is a last frame camera pose.

C++ default parameters

  • camera_pose: Matx44f::eye()

pub fn get_cloud(
    &self,
    points: &mut dyn ToOutputArray,
    normals: &mut dyn ToOutputArray
) -> Result<()>
[src]

Gets points and normals of current 3d mesh

The order of normals corresponds to order of points. The order of points is undefined.

Parameters

  • points: vector of points which are 4-float vectors
  • normals: vector of normals which are 4-float vectors

pub fn get_points(&self, points: &mut dyn ToOutputArray) -> Result<()>[src]

Gets points of current 3d mesh

The order of points is undefined.

Parameters

  • points: vector of points which are 4-float vectors

pub fn get_normals(
    &self,
    points: &dyn ToInputArray,
    normals: &mut dyn ToOutputArray
) -> Result<()>
[src]

Calculates normals for given points

Parameters

  • points: input vector of points which are 4-float vectors
  • normals: output vector of corresponding normals which are 4-float vectors

pub fn reset(&mut self) -> Result<()>[src]

Resets the algorithm

Clears current model and resets a pose.

pub fn get_pose(&self) -> Result<Affine3f>[src]

Get current pose in voxel space

pub fn update(&mut self, depth: &dyn ToInputArray) -> Result<bool>[src]

Process next depth frame

Integrates depth into voxel space with respect to its ICP-calculated pose. Input image is converted to CV_32F internally if has another type.

Parameters

  • depth: one-channel image which size and depth scale is described in algorithm's parameters

Returns

true if succeeded to align new frame with current scene, false if opposite

Loading content...

Implementations

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

pub fn create(_params: &Ptr<Kinfu_Params>) -> Result<Ptr<dyn Kinfu_KinFu>>[src]

Implementors

Loading content...