In the first part of the week, a method to evaluate the point cloud density inside a cuboid with a predefined size was developed. This allowed creating a grid of cuboids in which each one had its own correspondent density. The purpose was to divide the space of interest in small enough portions for later evaluate density changes.
The first necessary procedure was to transform the PointCloud to the moving_axis frame of the car, and then use the PCL CropBox tool to crop the PointCloud in the defined cuboid volume and count the numbers of points in the output cloud.
Vid. 1 shows a dynamic use of this method. For better visual outcome, each square of the grid has a color that matches a range of densities, which allows already to some understanding of what are the low and high density zones.
After the development of the density grid, followed the implementation of similar gradient grids. To each cuboid, the vertical and horizontal gradient were calculated (Gx and Gy, in vid. 2), as well as the gradient magnitude and direction.
In vid. 2 there is a representation of the four gradient grids with the color bars created (fig. 1).