Template Function backend::convertPointCloudToDepthMap

Function Documentation

template<typename PointCloudType>
bool backend::convertPointCloudToDepthMap(const PointCloudType &point_cloud_C, const aslam::Camera &camera, const bool use_openni_format, const bool create_range_image, cv::Mat *depth_map, cv::Mat *image)

Converts a point cloud to a depth map + optionally an intensity image.

Parameters
  • point_cloud_C[in] Point cloud in camera coordinate frame, which is x-right, z-front, y-down

  • camera[in] Camera model of the desired depth map

  • use_openni_format[in] If enabled, the depth map will be in the OpenNI format ()[mm], uint16_t), otherwise in floating point format [m].

  • create_range_image[in] If enabled, the depth map will not contain the Z coordinate of the 3D point but the actual ray length from the camera center to the 3D point. NOTE This is required for cameras of type Camera3DLidar!

  • depth_map[out] OpenCV depth map, will be set to either CV_32FC1 (depth in m) or CV_U16C1 (depth in mm)

  • image[out] OpenCV intensity image, will be set to CV_8UC1 or CV_8UC3, depending on the availablility of intensity vs color.It will be unallocated if no intensity or color is available.