IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
Point Cloud

A point cloud is a set of data points defined in a three-dimensional (3D) coordinate system. Each point is represented by its X, Y, and Z coordinates, specifying its exact position in 3D space. Point clouds are often generated from depth maps, such as those obtained from a time-of-flight camera. They serve as a detailed digital representation of the shape and size of physical objects, enabling precise measurements and analysis.

Requirements

The result of a Camera Calibration is needed to create a point cloud from a depth map image. This depth map can originate from a time-of-flight camera, for example. Its gray values represent distances in metric units. For more information see the Camera Calibration Guide.

Example results

Depth map Point cloud
Depth map image Created Point Cloud in CloudCompare

Usage instructions

To create a point cloud using one of the provided interfaces, follow the steps below:

  • C++
    // Load calibration parameters
    peak::icv::CalibrationParameters calibrationParameters{ "calibration_parameters.json" };
    //
    // Read the depth values
    peak::icv::Image depthMap = ReadDepthMap();
    //
    // Apply lens undistortion using calibration parameters
    peak::icv::Undistortion undistortion(calibrationParameters.GetIntrinsicParameters());
    auto undistortedDepthMap = undistortion.Process(depthMap);
    //
    // Generate the point cloud by converting depth data to 3D coordinates
    peak::icv::PointCloudXYZ pointCloud{ undistortedDepthMap };
  • C#
    // Load calibration parameters
    var calibrationParameters = new CalibrationParameters("calibration_parameters.json");
    //
    // Read the depth values
    using var depthMap = new Image("depth_map.tiff", PixelFormat.Coord3D_C32f);
    //
    // Apply lens undistortion using calibration parameters
    using var undistort = new Undistortion(calibrationParameters.IntrinsicParameters);
    using var undistortedDepthMap = undistort.Process(depthMap);
    //
    // Generate the point cloud by converting depth data to 3D coordinates
    using var pointCloud = new PointCloudXYZ(undistortedDepthMap);
  • Python
    # Load calibration parameters
    calibration_parameters = CalibrationParameters.create_from_file("calibration_parameters.json")
    #
    # Read the depth values
    depth_map = read_depth_map()
    #
    # Apply lens undistortion using calibration parameters
    undistort = Undistortion(calibration_parameters.intrinsic_parameters)
    undistorted_depth_map = undistort.process(depth_map)
    #
    # Generate the point cloud by converting depth data to 3D coordinates
    point_cloud = PointCloud.create_from_undistorted_depth_map(undistorted_depth_map)

Creating a point cloud from a depth map involves two main steps:

  • Undistort the depth map to correct distortions caused by the camera lens.
  • Compute 3D points from the undistorted depth information.

Both steps require the camera's intrinsic calibration parameters. First, load these parameters into an instance of CalibrationParameters.

The Undistortion class is used to transform a distorted depth map into an undistorted version. To use it, instantiate the class with the appropriate intrinsic parameters. The process function performs the undistortion on the provided image and returns an UndistortedImage object. This returned object contains the undistorted image along with the intrinsic parameters.

Generate the point cloud by instantiating the class with the undistorted depth map obtained in the previous step. The 3D coordinates are computed using the camera matrix derived from the intrinsic parameters.