Table of Contents

Method VoxelGridSampling

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

VoxelGridSampling(OutputArray, InputArray, float, float, float)

Point cloud sampling by Voxel Grid filter downsampling.

Creates a 3D voxel grid (a set of tiny 3D boxes in space) over the input point cloud data. In each voxel, all the points present are approximated (downsampled) with the point closest to their centroid.

public static int VoxelGridSampling(OutputArray sampledPointFlags, InputArray inputPts, float length, float width, float height)

Parameters

sampledPointFlags OutputArray

Output flags of the sampled points. sampledPointFlags[i] is 1 if the i-th point is selected, 0 otherwise.

inputPts InputArray

Original point cloud, Mat of size Nx3/3xN.

length float

Grid length.

width float

Grid width.

height float

Grid height.

Returns

int

The number of points actually sampled.