Assignment 03
Ground filtering
Deadline is 2022-01-14 11:59am
Late submission? 10% will be removed for each day that you are late.
You’re allowed for this assignment to work in a group of 3 (and thus submit only one solution for the three of you). You are free to form a group yourself; if you’re looking for a partner let us know (Ravi or Hugo), or let others know on Discord. If you prefer to work alone or with another person it’s also fine.
- Overview
- YouTube video to help you start
- What you are given to start
- To compile and run the C++ program
- The output format
- Good to know
- What to submit and how to submit it
- Marking
Overview
The aim of this assignment is to write a program that implements two ground filtering methods (both described in the book):
- Ground filtering with TIN refinement (GFTIN)
- Cloth simulation filter algorithm (CSF)
The program will read a point cloud from a LAZ file, run both ground filtering algorithms with user defined parameters, and output a new LAS/LAZ file that contains the ground filtering results (encoded in the LAS classification field).
You will also have to analyse the differences between the two ground filtering methods and the original LAS ground classification ans summarise your findings in a report.
You can do this assignment using either Python or C++. We recommend C++, as this will prepare you for the courses in the next two quarter (C++ is the language use in GEO1004 and GEO1016).
YouTube video to help you start
What you are given to start
Code is in the /hw/03/
folder of the GitLab repository of the course. It is recommended to use git
to clone the repository to your machine.
Python
python/geo1015_hw03.py
is the main(). You are not allowed to modify this file!python/mycode_hw03.py
is where all your code should go. The 3 functions defined there must be completed, and you are not allowed to change the input parameters. You are of course allowed to add any other functions you want in that unit (please do not include any other unit you code, add your code to that single file). You are only allowed to import modules from the Python standard library (anything you installed throughpip
is thus not allowed, except scipy, numpy, startinpy, and laspy). Notice that the functions we have defined do not return anything, instead they write the output file to the disk; you cannot change this behaviour.
To install laspy and have LAZ support, this should work: pip install laspy'[laszip]'
, see installation.
C++
cpp/src/main.cpp
contains themain()
function where the execution of the program starts. You may not modify this file.cpp/src/GroundFilter.h
declares all the important functions for this assignment.cpp/src/GroundFilter.cpp
this is where most of your implementation should go. You need to complete 2 functions here. You may only add includes from the C++ standard library (C++17) and CGAL with the exception of the Classification module.
Data and parameters
/data/params.json
: a simple JSON file that defines the input and output LAS files and parameters for the ground filtering algorithms (they are listed in the source in the comments at the functions where they are relevant). It is used both by the C++ and Python variants of this assignment./data/*.laz
: several input files that you can use for testing.
The input file params.json
doesn’t need to be validated (no wrong parameters can be in a given file), and the input/output and parameters are also valid.
To compile and run the C++ program
Below are instruction to get you up and running with the C++ code (if you pick python you can skip this section). It is highly recommended that you use an IDE with debug functionality such as CLion.
You only need to install CGAL for this assignment, the other libraries are in the folder cpp/external
.
Once you have successfully completed the instructions below you can start editing the source files.
Windows
- We recommend you use WSL and that you follow that tutorial.
Mac
- Open a terminal window and type
xcode-select --install
to install the C++ compiler on your system. - Install homebrew
- Use homebrew to install CGAL
brew install cgal
, all other dependencies are provided in the code we give you.
Linux
- Install dependencies with
sudo apt-get install build-essential libssl-dev libcgal-dev
Running the program in Clion
- Install CLion (you can request a free education license).
- Open CLion, click the Open button and select the
/hw/03/cpp
folder (do not create a new project). - Make sure
hw03
is the build target. - Compile and run the program by pressing the button with the big green triangle. After compiling and running has finished you should see the following output:
Active working directory: "/Users/ravi/git/geo1015_material/hw/2021/hw03/cpp/../data" === TIN refinement groundfilter === -->0.000s === CSF groundfilter === -->0.000s
NOTE: building the program in
Release
mode is a lot faster! The defaultDebug
mode is the best for debugging, but once you are done with that and want to try several parameters with the full pointcloud you may want to switch to build typeRelease
(You may need to add a CMake profile for this in CLion under Preferences > Build, Execution, Deployment > CMake).
The output format
Your output file is a LAS file. It will contain the same points as in the input LAS file, but you will set the classification field for each point according to the results of your ground filtering implementation. You only need to use these classification codes:
- ‘2’ for ground points
- ‘1’ for all the other points
Notice that the input LAS/LAZ files are already classified. You should not use this classification in your algorithm, but use it to verify your results.
Good to know
- LAZ can be tricky to read/write with some library and some OS, you are thus allowed to read/write LAS (just convert the input files to LAS)
- To speed up development and testing you can use thinning (ie only load a random subset of the input point cloud) or crop the input datasets, however you final results need to be with the full pointcloud!
- you can override what
.json
file is loaded by specifying it as the first argument to the program. - you may assume the input coordinates are always in meters.
- you can inspect the LAS/LAZ files with CloudCompare.
What to submit and how to submit it
You have to submit:
- All the source files required to run your program.
params.json
with your optimal parameters for thepart_wassenaar_ahn3.laz
dataset.- a short report (about 10-15 pages) in PDF (no Word file please) where you elaborate on:
- how did you select the optimal parameters? why are they optimal?
- the differences between the results of the two ground filtering algorithms
- a comparison of you ground filtering results and the ground class from the input AHN3 LAS file.
Those files need to be zipped and the name of the file consists of the studentIDs of the members separated by a “_”, for example 5015199_4018169_4123169.zip
.
Upload the ZIP file to this dropbox page.
Marking
Criterion | Points |
---|---|
code works “out-of-the-box” | 1 |
report (quality, completeness) | 3 |
TIN refinement ground filtering | 3 |
CSF ground filtering | 3 |
[last updated: 2021-12-16 16:25]