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,25 @@
import cv2
import numpy as np
img = cv2.imread("../../data/teppich.png", cv2.IMREAD_GRAYSCALE)
''' FFT '''
IMG = np.fft.fft2(img)
MAGNITUDE = np.abs(IMG)
ANGLE = np.angle(IMG)
''' Filter out frequencies '''
print("Number of frequencies:", MAGNITUDE.shape)
MAGNITUDE[0:150, 0:150] = 0
''' IFFT '''
IMG = MAGNITUDE * np.exp(1j * ANGLE)
filtered_image = np.fft.ifft2(IMG).astype(np.float32)
''' Bild anzeigen '''
cv2.imshow("img", img)
cv2.imshow("filtered", filtered_image / np.max(filtered_image))
cv2.waitKey(0)