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

21
CV-App/algorithms/spin.py Normal file
View File

@@ -0,0 +1,21 @@
import cv2
import numpy as np
from . import Algorithm
class Spin(Algorithm):
""" Rotates an image """
def __init__(self):
self.current_angle = 0 # between 0 and 2 pi
self.anlge_per_image = 360 / 100
def process(self, img):
self.current_angle = (self.current_angle + self.anlge_per_image) % 360
w, h = img.shape[1], img.shape[0]
image_center = (w / 2, h / 2)
rot_mat = cv2.getRotationMatrix2D(image_center, self.current_angle, 1.0)
img = cv2.warpAffine(img, rot_mat, (w, h), flags=cv2.INTER_LINEAR)
return img