SO503 Spring 2017
Matlab and LIDAR Point Clouds/3D graphics
LIDAR point clouds come in a wide variety of formats. The simplest are
ASCII text files, with three values per line, x, y, and z. It is quite
likely, however, that that files will be too big to deal with in Excel, at least
the older versions of the program.
There are two variants:
- Whether or not there is a header line, with the names of the columns.
You can add or remove this with an editor like Notepad or Wordpad, although
Matlab does not appear to be very fussy about this.
- What separates the values (the delimiter, which can commonly be a comma,
a space, or a tab). You should look up the dlmread
command in the Matlab help to see how you can set the correct delimiter.
You can also do a global search and replace in an ASCII editor, but this is
likely to be painfully slow.
For serious use in computer mapping, the most common format is LAS, which is binary and
substantially more compact that these ASCII files. LAS files can have
hundreds of millions of points (up to 15 points per square meter, and I have now
seen one with 65 points per square meter), and be
gigabytes in size.
You will use the following Point Clouds. Note that the appropriate grid
size to create varies with the data set characteristics:
- v1-thin5.txt: from a historical ship.
(178,319 points; this was thinned by MICRODEM from a file 5 times
larger)--try a grid size of 0.1
- toronto.csv, from a Canadian city
(65,535 points; this was truncated by Excel from a larger file)--try a grid
size of 1
- 2008_NH_Portsmouth_30464_raw.txt (2326 points) --try a grid size of 1
Vineyard, which has X,Y,Z, and then the intensity and point classification.
Use a grid size of 1. Color code it using either the intensity or point
classification. If you import into a matrix, these will likely be in
columns 4 and 5, which you can use for the coloring. You can view the file at
manipulate it in the web browser, which will also work on an Android phone or
We will use 3D graphics later to look at the 3D distribution of water
properties recorded by a CTD.
We will be doing
Lab 1 in the reading, which starts on page 32. You have the data files
already, so you can jump to the middle of page 35 for directions on using Matlab.
We do not have an m file to start with, but you can use the code on page 38 as a
starting point. Note that these procedures will be happiest with data
imported as a matrix, which is a little different than we have used to date when
we have used vectors.
You will ultimately produce Figures for all four datasets; if your Matlab is
slow, you might think about which data set will be best (fewest or most points?) to use while you are
debugging your code. You must use the same code, and just change a few
variables at the beginning to deal with the different data sets.
Create the following figures (you might have to check the help on the
parameters to use with each; there are samples of the output from all 5 below):
You can open the first three files in MICRODEM with the Point Clouds menu choice.
For the vineyard file, you need so to insert column names in a new first line.
Turn in for this lab:
- At least 5 figures, one from each of the commands above, with all the data
sets represented among your graphs so that I can be sure you successfully
imported each data set. You should insure that you export as dumb
pictures, and not as an embedded object, or you will have a painful slowdown
every time your Word screen tries to redraw. If that occurs when I try
to grade your paper, it will come back to you for correction, so get it
right the first time.
- A good figure showing the vineyard in Germany.
- Your matlab source code, showing how you modified the code to deal with
the different input files. This should be a smart operation, and
not just copying the code three times. Set all required variables at
the beginning of the program. This is also where you should set the
coloring option for the vineyard. Document this so someone else can
use your code.
- A discussion about whether you think the three data files are
essentially identical, or if they have geometric differences which determine
which of the visualization options best depicts the data. Consider the
difference between 2.5D and 3D.
- A comparison of the advantages and disadvantages of using Matlab to
visualize this kind of data, compared to a more specialized program.
- Does the smoothing filter make any noticeable difference? Should
you blindly use it? This will require a figure with a filtered and an
unfiltered view of the same data.
Links for this lab only available within USNA
Matlab figures for surfl, surface, surfc, trimesh, and
scatter3 for the smallest data set
MICRODEM Images for the two larger data sets