added scripts

This commit is contained in:
Mikołaj Pokrywka 2023-01-31 17:51:02 +01:00
parent b1eac6c382
commit 289e27165c
2 changed files with 34 additions and 0 deletions

18
frames/a.py Normal file
View File

@ -0,0 +1,18 @@
import cv2 as cv
letters =['L', 'L', 'L', 'L', 'L', 'L', 'L', 'T', 'C', 'C', 'C', 'C', 'O', 'D', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'O', 'D', 'D', 'A', 'A', 'C', 'C', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L']
for i, l in enumerate(letters):
image = cv.imread(f"frame{i}.jpg", cv.IMREAD_COLOR)
image = cv.cvtColor(image, cv.COLOR_BGR2RGB)
cv.putText(image, l, (10, 100), cv.FONT_HERSHEY_SIMPLEX , 1, (255,0,0), 5)
image =cv.resize(image, [300, 300])
image = cv.cvtColor(image, cv.COLOR_RGB2BGR)
cv.imwrite(f'post/{i}.jpg', image)

16
frames/post/b.py Normal file
View File

@ -0,0 +1,16 @@
import cv2
import numpy as np
import glob
frameSize = (300, 300)
out = cv2.VideoWriter('2__output_video.avi',cv2.VideoWriter_fourcc(*'DIVX'), 30, frameSize)
for i in range(79):
img = cv2.imread(f"{i}.jpg")
print(f"{i}.jpg")
out.write(img)
out.release()