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

36
1_Grundlagen/ü3/l_b.py Normal file
View File

@@ -0,0 +1,36 @@
import numpy as np
import cv2
# Einlesen des Bildes
filepath = "../../data/lena.png"
img = cv2.imread(filepath)
'''
Anwendung der Schritte:
0. Für die Berechnung werden die Bilder in das kontinuierliche np.float64 konvertiert.
1. In Wertebereich {0, ..., 127}
2. In Wertebereich {0, ..., 3}
3. In Wertebereich {0, ..., 255}
'''
img_step0 = img.astype(np.float64)
img_step1 = np.round(127 * np.copy(img_step0) / 255)
img_step2 = np.round(3 * np.copy(img_step1) / 127)
img_step3 = np.round(255 * np.copy(img_step2) / 3)
'''
Für die Darstellung von np.float64 Bildern wird der Wertebereich von {0, ..., n_max} in [0, 1] projeziert.
Dabei entspricht der Wert 1 dem ehemaligen Maximum n_max.
'''
img_step0 = img_step0 / 255
img_step1 = img_step1 / 127
img_step2 = img_step2 / 3
img_step3 = img_step3 / 255
cv2.imshow("Schritt 0", img_step0)
cv2.imshow("Schritt 1", img_step1)
cv2.imshow("Schritt 2", img_step2)
cv2.imshow("Schritt 3", img_step3)
cv2.waitKey(0)