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

The aim of this assignment is to write a program that implements two ground filtering methods (both described in the book):

  1. Ground filtering with TIN refinement (GFTIN)
  2. 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

  1. python/geo1015_hw03.py is the main(). You are not allowed to modify this file!
  2. 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 through pip 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++

  1. cpp/src/main.cpp contains the main() function where the execution of the program starts. You may not modify this file.
  2. cpp/src/GroundFilter.h declares all the important functions for this assignment.
  3. 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

  1. /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.
  2. /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

  1. We recommend you use WSL and that you follow that tutorial.

Mac

  1. Open a terminal window and type xcode-select --install to install the C++ compiler on your system.
  2. Install homebrew
  3. Use homebrew to install CGAL brew install cgal, all other dependencies are provided in the code we give you.

Linux

  1. Install dependencies with sudo apt-get install build-essential libssl-dev libcgal-dev

Running the program in Clion

  1. Install CLion (you can request a free education license).
  2. Open CLion, click the Open button and select the /hw/03/cpp folder (do not create a new project).
  3. Make sure hw03 is the build target.
  4. 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 default Debug 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 type Release (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:

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

What to submit and how to submit it

You have to submit:

  1. All the source files required to run your program.
  2. params.json with your optimal parameters for the part_wassenaar_ahn3.laz dataset.
  3. 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]