-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (51 loc) · 1.91 KB
/
main.py
File metadata and controls
56 lines (51 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# main.py
import numpy as np
import cv2 as cv
from tree.generator import TreeGenerator
from tree.drawer import TreeDrawer
from tree.background import BackgroundDrawer
from tree.scene_generator import generate_scene
WIDTH, HEIGHT = 1200, 630
SKYLINE = int(HEIGHT * 0.8)
if __name__ == "__main__":
tree_gen = TreeGenerator()
scene1_trees = [
{
"tree": tree_gen.generate(300, SKYLINE, 61, np.pi / 2, np.pi / 5, 12),
"start_color": (255, 0, 0),
"end_color": (0, 255, 0),
"gradient": "linear"
},
{
"tree": tree_gen.generate(900, SKYLINE, 90, np.pi / 2, np.pi / 3.6, 12),
# "start_color": (0, 0, 255),
# "end_color": (255, 255, 0),
"start_color": (255, 0, 0),
"end_color": (0, 255, 150),
"gradient": "reverse"
},
# {
# "tree": tree_gen.generate(600, SKYLINE, 70, np.pi / 2, np.pi / 3, 11),
# "start_color": (255, 165, 0),
# "end_color": (34, 139, 34),
# "gradient": "constant"
# }
]
scenes = [
{"day": True, "sun": True, "moon": False, "text": "OpenCV and NumPy Explorer", "file": "scene_day_sun.png"},
{"day": False, "sun": False, "moon": True, "text": "OpenCV and NumPy Explorer", "file": "scene_night_moon.png"},
{"day": True, "sun": False, "moon": False, "text": "Cloudy Day", "file": "scene_day_cloudy.png"},
{"day": False, "sun": False, "moon": False, "text": "Dark Night", "file": "scene_night_dark.png"},
]
for scene in scenes:
generate_scene(
day=scene["day"],
with_sun=scene["sun"],
with_moon=scene["moon"],
text=scene["text"],
filename=fr"output\{scene['file']}",
trees=scene1_trees,
WIDTH=WIDTH,
HEIGHT=HEIGHT
)
print(": ) finished")