Table of Contents

Class Volume

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Custom volume (TSDF, HashTSDF or ColorTSDF) for point cloud integration and raycasting.

public class Volume : CvObject, IDisposable
Inheritance
Volume
Implements
Inherited Members

Constructors

Volume(VolumeType, VolumeSettings?)

Constructor of custom volume.

public Volume(VolumeType vtype = VolumeType.TSDF, VolumeSettings? settings = null)

Parameters

vtype VolumeType

the volume type [TSDF, HashTSDF, ColorTSDF].

settings VolumeSettings

the custom settings for volume. If null, a default VolumeSettings(TSDF) is used.

Methods

FetchNormals(InputArray, OutputArray)

Extracts the normals corresponding to the given existing points.

public void FetchNormals(InputArray points, OutputArray normals)

Parameters

points InputArray

the input existing points.

normals OutputArray

the storage of normals (corresponding to input points).

FetchPointsNormals(OutputArray, OutputArray)

Extracts all points and corresponding normals from the volume.

public void FetchPointsNormals(OutputArray points, OutputArray normals)

Parameters

points OutputArray

the storage of all points.

normals OutputArray

the storage of all normals, corresponding to points.

FetchPointsNormalsColors(OutputArray, OutputArray, OutputArray)

Extracts all points, normals and colors from the volume (only for ColorTSDF).

public void FetchPointsNormalsColors(OutputArray points, OutputArray normals, OutputArray colors)

Parameters

points OutputArray

the storage of all points.

normals OutputArray

the storage of all normals, corresponding to points.

colors OutputArray

the storage of all colors, corresponding to points (only for ColorTSDF).

GetBoundingBox(OutputArray, VolumeBoundingBoxPrecision)

Gets bounding box in volume coordinates with given precision.

public void GetBoundingBox(OutputArray bb, VolumeBoundingBoxPrecision precision)

Parameters

bb OutputArray

6-float 1d array containing (min_x, min_y, min_z, max_x, max_y, max_z) in volume coordinates.

precision VolumeBoundingBoxPrecision

bounding box calculation precision.

GetEnableGrowth()

Returns whether new volume units are allocated during integration (HashTSDF only).

public bool GetEnableGrowth()

Returns

bool

GetTotalVolumeUnits()

Returns number of volume units in volume.

public long GetTotalVolumeUnits()

Returns

long

GetVisibleBlocks()

Returns visible blocks in volume.

public int GetVisibleBlocks()

Returns

int

Integrate(InputArray, InputArray)

Integrates the input data to the volume.

public void Integrate(InputArray depth, InputArray pose)

Parameters

depth InputArray

the depth image.

pose InputArray

the pose of camera in global coordinates.

IntegrateColor(InputArray, InputArray, InputArray)

Integrates the input data to the volume (only for ColorTSDF).

public void IntegrateColor(InputArray depth, InputArray image, InputArray pose)

Parameters

depth InputArray

the depth image.

image InputArray

the color image (only for ColorTSDF).

pose InputArray

the pose of camera in global coordinates.

IntegrateFrame(OdometryFrame, InputArray)

Integrates the input data to the volume.

public void IntegrateFrame(OdometryFrame frame, InputArray pose)

Parameters

frame OdometryFrame

the object from which to take depth and image data.

pose InputArray

the pose of camera in global coordinates.

Raycast(InputArray, OutputArray, OutputArray)

Renders the volume contents into an image.

public void Raycast(InputArray cameraPose, OutputArray points, OutputArray normals)

Parameters

cameraPose InputArray

the pose of camera in global coordinates.

points OutputArray

image to store rendered points.

normals OutputArray

image to store rendered normals corresponding to points.

RaycastColor(InputArray, OutputArray, OutputArray, OutputArray)

Renders the volume contents into an image, also outputting colors (only for ColorTSDF).

public void RaycastColor(InputArray cameraPose, OutputArray points, OutputArray normals, OutputArray colors)

Parameters

cameraPose InputArray

the pose of camera in global coordinates.

points OutputArray

image to store rendered points.

normals OutputArray

image to store rendered normals corresponding to points.

colors OutputArray

image to store rendered colors corresponding to points (only for ColorTSDF).

RaycastEx(InputArray, int, int, InputArray, OutputArray, OutputArray)

Renders the volume contents into an image of the given size with the given intrinsics.

public void RaycastEx(InputArray cameraPose, int height, int width, InputArray K, OutputArray points, OutputArray normals)

Parameters

cameraPose InputArray

the pose of camera in global coordinates.

height int

the height of result image.

width int

the width of result image.

K InputArray

camera raycast intrinsics.

points OutputArray

image to store rendered points.

normals OutputArray

image to store rendered normals corresponding to points.

RaycastExColor(InputArray, int, int, InputArray, OutputArray, OutputArray, OutputArray)

Renders the volume contents into an image of the given size with the given intrinsics, also outputting colors (only for ColorTSDF).

public void RaycastExColor(InputArray cameraPose, int height, int width, InputArray K, OutputArray points, OutputArray normals, OutputArray colors)

Parameters

cameraPose InputArray

the pose of camera in global coordinates.

height int

the height of result image.

width int

the width of result image.

K InputArray

camera raycast intrinsics.

points OutputArray

image to store rendered points.

normals OutputArray

image to store rendered normals corresponding to points.

colors OutputArray

image to store rendered colors corresponding to points (only for ColorTSDF).

Release()

Clean up any resources being used.

public void Release()

Reset()

Clears all data in volume.

public void Reset()

SetEnableGrowth(bool)

Enables or disables new volume unit allocation during integration (HashTSDF only).

public void SetEnableGrowth(bool v)

Parameters

v bool