"""
CVBpy Example Script
1. Creates a calibrated point cloud from a range map aquired
by a laser triangulation setup (for further information see
<a htref="https://help.commonvisionblox.com/NextGen/15.0/md_theory_of_operation_tools__metric.html">here</a>).
2. Converts it to a numpy array without copying.
3. Modifies point cloud values through numpy.
4. Saves the point cloud.
Requires: numpy
"""
import os
import cvb
print("Loading range map and calibration file.")
), "tutorial", "Metric", "Images", "RangeMapCalibrationPattern.tif"))
print("Creating calibrated point cloud.")
rangemap.planes[0], calibrator, cvb.PointCloudFlags.Float)
if np_array.flags["OWNDATA"]:
raise RuntimeError("cannot map to numpy array")
print("Modifying point cloud data via numpy array.")
for i in range(np_array.shape[0]):
for j in range(np_array.shape[1]):
if np_array[i, j, 2] < 0:
np_array[i, j, 2] = 0
np_array[i, j, 3] = 0
print("Saving: ./calibrated_cloud.ply")
cloud.save("calibrated_cloud.ply")
Union[cvb.Calibrator3DAT, cvb.LaserPlaneHomographyCalibrator3D, cvb.LaserPlaneZigZagCalibrator3D, cvb.FactorsCalibrator3D, cvb.MatrixCalibrator3D, cvb.PinholeCameraCalibrator3D] load(str file_name)
Union[cvb.PointCloud, cvb.DensePointCloud, cvb.SparsePointCloud] create(cvb.ImagePlane range_map, cvb.Calibrator3D calibrator, int flags, Union[Type[cvb.PointCloud|cvb.DensePointCloud|cvb.SparsePointCloud]] point_cloud_type=DensePointCloud)
numpy.array as_array(Any buffer, bool copy=False)