With the increased popularity of 3D imaging and scanning I thought it would be easy to transform a xyz point cloud into a Height Map (xy matrix of z points), but after a couple of hours searching I found nothing. Maybe I'm looking in the wrong direction, isn't there some C++ library for this type of conversion?
Think of this as a point cloud over a chess board. Then, for each of the squares of the board, find all the points that lie over that square (i.e., whose $x,y$ values are within that square) and take the maximal $z$ value to generate the height over that square.
Of course, you're not bound to an $8\times 8$ board, but can choose the number of squares. You want to choose it in such a way that you have a sufficient number of points over each of the squares so that you get a reasonable approximation of the actual height, without "empty" squares.