Initial commit with project files

This commit is contained in:
2025-06-27 14:34:11 +02:00
commit 7ea3207e63
310 changed files with 9331 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
# Übung 3: Binärbild Repräsentationen
In dieser Übung werden Darstellungsformen von Binärbildern betrachtet. Sie lernen Binär und Quaternärbäume kennen.
## Aufgabe a) Binärbaum
Gegeben ist folgender Binärbaum:
![](./data/binary_tree.png)
Rekonstruieren Sie die Bildzeile, die durch den Binärbaum dargestellt wird.
Sie können die Aufgabe mit Papier und Stift erledigen. Die Lösung wird in dem Skript *l_a.py* visualisiert.
## Aufgabe b) Quaternärbaum
Gegeben ist folgender Quaternärbaum (Quadtree) mit einer Zuordnung der vier Quadranten:
![](./data/quad_tree.png)
Rekonstruieren Sie das Binärbild, die durch den Quaternärbaum dargestellt wird.
Sie können die Aufgabe mit Papier und Stift erledigen. Die Lösung wird in dem Skript *l_b.py* visualisiert.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,16 @@
import numpy as np
import cv2
line = np.asarray(
[[1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1]],
)
# Resize image
line = np.repeat(line, 50, axis=1)
line = np.repeat(line, 50, axis=0)
# Add seperators
line[0::2, ::50] = 1
line[1::2, ::50] = 0
# Show image
line = line.astype(np.float64)
cv2.imshow("Binaerbaum", line)
cv2.waitKey(0)

View File

@@ -0,0 +1,32 @@
import numpy as np
import cv2
line = np.asarray(
[
[1,1, 1,1, 1,1, 1,1],
[0,0, 1,1, 1,1, 1,1],
[0,0, 1,1, 0,0, 0,1],
[0,0, 1,0, 0,0, 1,1],
[0,0, 0,0, 0,0, 1,1],
[0,0, 0,0, 0,0, 1,1],
[0,0, 0,0, 1,0, 1,1],
[0,0, 0,0, 1,1, 1,1],
],
)
# Resize image
line = np.repeat(line, 50, axis=1)
line = np.repeat(line, 50, axis=0)
# Add seperators
line[0::2, ::50] = 1
line[1::2, ::50] = 0
line[::50, 0::2] = 1
line[::50, 1::2] = 0
# Show image
line = line.astype(np.float64)
cv2.imshow("Quadtree", line)
cv2.waitKey(0)