CVBpy 15.0
DensePointCloud Class Reference

A dense Cartesian 3D point cloud object. More...

Inherits PointCloud.

Public Member Functions

cvb.DensePointCloud crop (self, cvb.Cuboid clip_box)
 Creates a new point cloud which only consists of the points inside the clip box. More...
 
cvb.DensePointCloud frustum_crop (self, cvb.Cuboid clip_box, cvb.Angle theta, cvb.Angle phi)
 Creates a new point cloud which only consists of the points inside the clip box. More...
 
cvb.DensePointCloud plane_crop (self, cvb.Plane3D plane, cvb.NumberRange range, int crop_range)
 Creates a new point cloud where points within or outside a range parallel to given plane are cropped. More...
 
cvb.DensePointCloud plane_crop (self, cvb.Plane3D plane, float threshold, Optional[int] crop_below_above)
 Creates a new point cloud which only consists of the points below or above given plane. More...
 
cvb.DensePointCloud shrink (self)
 Creates a new dense point cloud where non-confident points at the borders are removed. More...
 
cvb.SparsePointCloud to_sparse_point_cloud (self)
 Creates a sparse point cloud from this dense point cloud with confidence plane. More...
 
- Public Member Functions inherited from PointCloud
cvb.Cuboid calculate_bounding_box (self)
 Calculates the minimum and maximum extent of the point cloud. More...
 
cvb.Point3D calculate_center_of_gravity (self)
 Gets the center of gravity of the point cloud. More...
 
cvb.Matrix3D calculate_covariance_matrix (self)
 Get the covariance matrix of the point cloud. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudconvert (self, int flags)
 Creates a new point cloud, which is a copy from this point cloud, but with possibly different data type and number of components. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointClouddown_sample (self, int mode, int value)
 Creates a new point cloud which has several points being removed dependent on the down sample mode and value. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudduplicate (self)
 Creates a new point cloud which is a copy from this point cloud. More...
 
cvb.Plane3D fit_plane (self, Optional[cvb.Cuboid] aoi)
 Fits a plane in the points of the point cloud. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudfrom_composite (cvb.Composite composite)
 Creates a point cloud from a composite. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudmatrix_transform (self, cvb.Matrix3DH matrix)
 Creates a new point cloud with all points being transformed by the given transformation. More...
 
cvb.Image range_map (self, cvb.NumberRange x_range, cvb.NumberRange y_range, cvb.Size2D size, float background)
 Creates a new range map image via linear projection in negative z-direction. More...
 
None save (self, str file_name, Optional[int] flags=cvb.PointCloudFlags.Float)
 Saves the given point cloud to the file with the given file_name. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudscale (self, Union[cvb.Factors3D, List[float]] factors)
 Creates a new point cloud with all points being scaled by the given factors. More...
 
Union[cvb.DensePointCloud, cvb.SparsePointCloudtransform (self, cvb.AffineMatrix3D transformation)
 Creates a new point cloud with all points being transformed by the given transformation. More...
 

Properties

 lattice_size = property
 cvb.Size2D: Gets the number of x, y, z (,w) point rows and columns of the given dense PointCloud.
 
- Properties inherited from PointCloud
 data_type = property
 cvb.DataType: Gets the DataType of the x, y, z(, w) components of the given PointCloud.
 
 layout = property
 int: Gets the layout of the available buffers / planes of the given point cloud (see cvb.PointCloudLayout).
 
 num_points = property
 int: Gets the number of x, y, z(, w) points in the given point cloud.
 
 plane_count = property
 int: Gets the number of planes enumerated by this object.
 
 planes = property
 List[cvb.Plane]: Gets all available planes enumerated by this object.
 

Detailed Description

A dense Cartesian 3D point cloud object.

A dense point cloud is an ordered set of 3D points, placed on a grid with a given width and height. The advantage of dense clouds is to have immediate neighbor information. The disadvantage is, that you cannot have arbitrary clouds (e.g.an affine transformation breaks the lattice view). Also each x - y - position can have only one corresponding z - height. A dense point cloud has grid / neighbor information available and has a larger memory than a sparse point cloud(due to NaN values / holes). Each dense point cloud can be converted to a sparse point cloud.

Member Function Documentation

◆ crop()

cvb.DensePointCloud crop (   self,
cvb.Cuboid  clip_box 
)

Creates a new point cloud which only consists of the points inside the clip box.

Parameters

clip_box : cvb.Cuboid Cuboid defining the bounds for the points to be copied (min/max are inclusive).

Returns

cvb.DensePointCloud The new point cloud.

◆ frustum_crop()

cvb.DensePointCloud frustum_crop (   self,
cvb.Cuboid  clip_box,
cvb.Angle  theta,
cvb.Angle  phi 
)

Creates a new point cloud which only consists of the points inside the clip box.

The orientation of the two boundary planes Z=Zmin and Z=Zmax can be modified by angles theta and phi. For theta, phi = 0,0 the function will give the same result as crop(). Angle theta tilts the two Z - boundary planes towards the(positive) Y - axis. Additionally, phi rotates the tilted Z - boundary planes around the Z - axis(for theta = 0, phi will have no effect, because it is then just an inplane - rotation). The two Z - boundary planes will stay parallel, but no longer necessarily orthogonal to the lateral boundary planes. Note, that only the Z - boundaries are tilted and not the whole bounding box, i.e.X - and Y - boundaries will stay the same.

Parameters

clip_box : cvb.Cuboid Cuboid defining the bounds for the points to be copied (min / max are inclusive).

theta : cvb.Angle Tilt angle of the two Z-boundary planes Z=Zmin and Z=Zmax towards the positive Y - axis.

phi : cvb.Angle Rotation angle of the tilted Z-boundary planes around the Z - axis.If Theta = 0, Phi will have no effect.

Returns

cvb.DensePointCloud

◆ plane_crop() [1/2]

cvb.DensePointCloud plane_crop (   self,
cvb.Plane3D  plane,
cvb.NumberRange  range,
int  crop_range 
)

Creates a new point cloud where points within or outside a range parallel to given plane are cropped.

The plane is defined by the hessian normal form:

Points are cropped within or outside a range parallel to the given plane. The range is defined by range. Note, that Range.Max and Range.Min are applied along normal direction.

In order to define a range around the plane, maximum and minimum range have to be positive and negative respectively.

Note
Cropped points are set non-confident. Lines and columns at the borders containing only non-confident points are removed. If the input point cloud does not contain a confidence plane, a confidence plane will be added to the cropped point cloud.

Parameters

plane : cvb.Plane3D Points parallel to this plane will be cropped.

range : cvb.NumberRange Points within or outside this range will be cropped.

crop_range : int Indicates whether points should be cropped within or outside the range.

Returns

cvb.DensePointCloud Cropped point cloud.

◆ plane_crop() [2/2]

cvb.DensePointCloud plane_crop (   self,
cvb.Plane3D  plane,
float  threshold,
Optional[int]  crop_below_above 
)

Creates a new point cloud which only consists of the points below or above given plane.

The plane is defined by the hessian normal form:

Above plane means all points with z values greater than the plane are cropped. It makes no difference in which direction the given normal points. The normal is always converted, so that it points up (positive z value). Note, if Normal.Z equals 0, 'below' and 'above' is undefined and thus no cropping is done. Instead the input point cloud will be duplicated.

Note
Points beyond the plane are set non-confident. Lines and columns at the borders containing only non-confident points are removed. If the input point cloud does not contain a confidence plane, a confidence plane will be added to the cropped point cloud.

Parameters

plane : cvb.Plane3D Points beyond this plane will be cropped.

threshold : float Points below plane plus this value and points above plane minus this value are cropped respectively. This threshold should be set, if plane is calculated via fit_plane(). It ensures, that all points beyond this plane plus noise are cropped.

crop_below_above : Optional[int] Indicates if points should either be cropped below or above plane (optional, default value: cvb.CropDirection.Below).

Returns

cvb.DensePointCloud Cropped point cloud.

◆ shrink()

cvb.DensePointCloud shrink (   self)

Creates a new dense point cloud where non-confident points at the borders are removed.

Please ensure that your point cloud contains a confidence plane.

Returns

cvb.DensePointCloud The shrinked point cloud.

◆ to_sparse_point_cloud()

cvb.SparsePointCloud to_sparse_point_cloud (   self)

Creates a sparse point cloud from this dense point cloud with confidence plane.

Non - confident points will be removed and the confidence plane is not kept. The new sparse point cloud has the same planes as this dense point cloud(except confidence).

Returns

cvb.SparsePointCloud Converted sparse point cloud.