Commit 78c37c9c authored by Thomas Dowrick's avatar Thomas Dowrick
Browse files

Add test data for AutoCropper

parent 5da1ca3b
Pipeline #1920 failed with stages
in 74 minutes and 44 seconds
import cv2
import numpy as np
img = cv2.imread('davinci_xi.png')
img[80:462, 80:1000, :] = 0
centre = (640, 250)
lower = 0
upper = 255
width = 1277
height = 846
fourcc = cv2.VideoWriter_fourcc(*'MJPG')
filename = 'davinci_xi_generated_video.avi'
fps = 25
video_writer = cv2.VideoWriter(
filename, fourcc, fps, (width, height))
for i in range(100):
size = 100 + i
start_x = centre[0] - size
end_x = centre[0] + size
start_y = centre[1] - size
end_y = centre[1] + size
#print(start_x, end_x, start_y, end_y)
data = np.random.randint(lower, upper, (size*2, size*2, 3))
img[start_y:end_y, start_x:end_x, :] = data
# cv2.imshow('a', img)
# cv2.waitKey(10)
video_writer.write(img)
video_writer.release()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment