background

Niko's Project Corner

Visualizing laser scanned geography

Description Visualizing laser scanned point clouds.
Languages Matlab
C++
Tags Ren­der­ing
Data Struc­tures
Duration Summer 2012
Modified 7th July 2013
thumbnail

Dur­ing the sum­mer of 2012 when I was mainly work­ing on my Mas­ter's The­sis, I also had a look at Na­tional Land Sur­vey of Fin­land's open data down­load ser­vice. There I down­loaded a point cloud dataset which had typ­ically 4 - 5 mea­sured points / square me­ter. This means that to vi­su­al­ize a re­gion of 2.5 × 2 km, I had to work with a point cloud con­sist­ing of 5 × 2500 × 2000 → 25 mil­lion points. I chose to con­cen­trate on my cam­pus area, be­cause I know it well and it has many in­ter­est­ing land­marks. For ex­am­ple the iconic main build­ing can be seen in Fig­ure 1.

main_building
Figure 1: The iconic main build­ing of the Aalto Uni­ver­sity School of Sci­ence and Tech­nol­ogy.

From the satel­lite view at Fig­ure 2, we can iden­tify nu­mer­ous land­marks and re­gions such as the main build­ing on the left, sports cen­ter on the right and lots of trees and smaller build­ings. At the time of tak­ing these im­ages there was also an on­go­ing con­struc­tion pro­ject.

otaniemi_maps
Figure 2: Otaniemi cam­pus (Es­poo, Fin­land) satel­lite view from Google Earth.

At first I just loaded the whole point cloud of the re­gion into Mat­lab, but I quickly re­al­ized that the naive ap­proach would be too slow. Thus I de­cided to pre-pro­cess the data in C++, and use Mat­lab only for the fi­nal vi­su­al­iza­tion step. In C++ I in­serted all points into a quadtree data struc­ture, to en­able ef­fi­cient range queries. Only the lon­gi­tude and lat­itude were used, be­cause the height is ir­rel­evant in this sce­nario.

Once the data struc­ture was con­structed, it is used to sam­ple the point clouds on a reg­ular grid. In this case I cre­ated a dataset 2500 × 2000 me­ters, where it was sam­pled at one me­ter in­ter­vals. For each sam­ple point the data points within a ra­dius of 1.5 me­ters were queried. From these the min­imum and max­imum height were de­ter­mined, and also the av­er­age height us­ing a Gaus­sian ker­nel for weight­ing. These re­sults were stored into a txt file, which was then read in by Mat­lab.

In Mat­lab's out­put the pixel's bright­ness cor­re­sponds to the mean height, but there are two ad­di­tional col­or­ing rules. On the re­gions which con­tained trees, some of the laser rays hit trees' top, and some hit the ground level. By ob­serv­ing the height dif­fer­ence in low­est and high­est recorded point, it can be es­ti­mated whether there was a tree nearby. Iden­ti­fied trees are en­coded in green (us­ing YCbCR col­orspace).

An other heuris­tics was to iden­tify walls of the build­ings, by set­ting a cri­te­ria that they are at least 1.5 me­ters above the lo­cal ground level. Then these en­closed ar­eas are iden­ti­fied as build­ings, and are color coded as red in the fi­nal im­age, which can be seen in Fig­ure 3. The height pro­file of the main build­ing is clearly vis­ible, and most of the build­ings and trees are cor­rectly iden­ti­fied.

otaniemi_laser
Figure 3: A vi­su­al­iza­tion of the laser scanned point cloud at Otaniemi cam­pus (Es­poo, Fin­land).

The ren­dered out­put is com­pared against the satel­lite view, by us­ing the satel­lite im­age for grayscale in­for­ma­tion and the laser data's clas­si­fi­ca­tion as color chan­nels. As can be seen from Fig­ure 4, there is a very good agree­ment be­tween these two in­de­pen­dent data sources. The only main dif­fer­ences are one mis-clas­si­fied at the bot­tom right, and the large struc­ture that was at the sports cen­ter at the time when laser scan­ning took place. Most of the trees are cor­rectly iden­ti­fied as well.

otaniemi_overlay
Figure 4: The grayscale de­tail is from Google Earth's satel­lite im­age, and the col­or­ing in­di­cates the clas­si­fi­ca­tion which is based on laser data.

Related blog posts:

Agadmator
Fingerprints
MapStitcher
GlobalIllumination
CudaRendering