AdvancedSensorySystems Exercise 06
AdvancedSensorySystems Exercise 06
Summer 2024
Submission: Please submit your solutions for the complete exercise sheet until Thursday, 13 June
2024, 10:15!
You may work in groups of up to three. Please note the full names of you and all your exercise
partners on the submission. Only one submission per group is necessary. Create a single PDF-document
containing your answers/plots/screenshots. Add your source code to a zip-file and upload the two files
to WueCampus.
WueCampus course: https://wuecampus.uni-wuerzburg.de/moodle/course/view.php?id=66976
Goals: In this assignment you will analyse data structures for 3D point cloud processing.
1
Task 1: Visualizing kD-trees (20 points)
The file marktplatz.pts contains a point cloud from terrestrial laser scanning. Each line in the file
contains one point with x, y, z coordinates in m. The z-coordinate corresponds to the height. For
reference two views of the data are given in Fig. 2.
In this task we will use this data to visualize a kD-tree. The idea is to generate a cut through the scene
at a specific height that displays all the bounding boxes of the kD-tree that intersect with this height
and the points contained within the leaf nodes at this height.
2
Figure 2: Würzburg market square point cloud colored by height.
Todo-list:
1. On WueCampus you find a C++ implementation of a kD-tree. Briefly describe the construction
of the kD-tree in this implementation. How is the split axis chosen and what is the split rule?
2. Write a C++ program, that reads the data and creates a kD-tree containing all the points.
(Example code provided!)
3. Extend the kD-tree by a function that returns all the bounding boxes that intersect with a specific
height and the points contained within the leaf nodes that intersect with the given height.
4. Write a function that generates an image displaying the cut through the kD-tree. Use different
colors for the bounding boxes of the leaf nodes, the bounding boxes of the internal nodes and the
points contained within the leaf nodes. (Example code provided! Alternatively, you can write the
bounding boxes and leaf node points to text files and plot the cut with any plotting tool you like
to use.)
5. Generate cuts through the scene at a height of 1 m, 10 m and 20 m. A recommendation for the
image size is to have one pixel correspond to 10 cm × 10 cm. Describe your results. Submit the
generated images of the visualization for each cut.
Figure 3: Visualization of a kD-tree of the Standford bunny. The cut is performed parallel to the image
plane.
3
Hint: The point cloud consists of ca. 13 million points. If you are running into memory issues, it is
O.K. to use only every nth point or take one of the provided point clouds with reduced number of points.
You might want to look into this sample code to speed up reading the point data from the file:
(Example code provided!)
struct Point {
double x;
double y;
double z;
};
while (!feof(file)) {
Point tmp;
fscanf(file, "%lf %lf %lf",&tmp.x, &tmp.y, &tmp.z);
points.push_back(tmp);
}
fclose(file);
}
4
Task 2: Generating trees for point cloud processing (10 points)
In this exercise we use the depicted points to explain the generation of Quadtrees and kD-trees.
D J
1. Generate a Quadtree using the given points. Sketch the bounding boxes and tree structure. Briefly
explain the process.
2. Generate a kD-tree using the given points. Sketch the bounding boxes and tree structure. Briefly
explain the process. Make sure to explain the split rule that you are using.
4. What are the general advantages and disadvantages of kD-trees and Octrees for 3D point cloud
data? Name at least one advantage and one disadvantage for each tree type.