Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
b318d544
宇宙模拟器
项目概览
Python_超人
/
宇宙模拟器
通知
19
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
宇宙模拟器
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b318d544
编写于
7月 04, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
d344eb33
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
6 deletion
+30
-6
common/consts.py
common/consts.py
+2
-0
tools/sim_video_3d_cap.py
tools/sim_video_3d_cap.py
+27
-5
tools/sim_video_cap.py
tools/sim_video_cap.py
+1
-1
未找到文件。
common/consts.py
浏览文件 @
b318d544
...
...
@@ -7,6 +7,8 @@
# python_version :3.8
# ==============================================================================
# 模拟器的标题
WINDOW_TITLE
=
""
"""
太阳质量是用于测量恒星或如星系类大型天体的质量单位。
...
...
tools/sim_video_3d_cap.py
浏览文件 @
b318d544
...
...
@@ -118,8 +118,10 @@ if __name__ == '__main__':
# show_image(img)
video
=
create_video
(
args
,
img
.
shape
[
0
],
img
.
shape
[
1
])
imageNum
=
0
r_frames
=
[]
l_frames
=
[]
index_base
=
0
last_index
=
0
r_frames
=
{}
l_frames
=
{}
print
(
"开始录屏"
)
while
True
:
img
=
sim_window_screen_shot
()
...
...
@@ -128,15 +130,24 @@ if __name__ == '__main__':
break
_3d_card
=
img
[
4
:
20
,
3
:
20
,
]
_3d_card_p
=
_3d_card
[
10
,
10
,
]
_3d_card_p
=
_3d_card
[
10
,
10
,]
index
=
_3d_card_p
[
1
]
+
_3d_card_p
[
0
]
if
index
<
last_index
:
index_base
+=
(
last_index
+
1
)
last_index
=
index
index
=
index
+
index_base
if
_3d_card_p
[
2
]
<
100
:
_3d_card_color
=
"b"
_3d_card_direct
=
"right"
r_frames
.
append
((
_3d_card_p
[
1
]
+
_3d_card_p
[
0
],
img
[:
432
,
:
768
,
]))
if
index
not
in
r_frames
.
keys
():
r_frames
[
index
]
=
img
[:
864
,
:
768
,
]
else
:
_3d_card_color
=
"w"
_3d_card_direct
=
"left"
l_frames
.
append
((
_3d_card_p
[
1
]
+
_3d_card_p
[
0
],
img
[:
432
,
:
768
,
]))
if
index
not
in
l_frames
.
keys
():
l_frames
[
index
]
=
img
[:
864
,
:
768
,
]
# if is_blank_screen(img):
# if imageNum % args.fps == 0:
...
...
@@ -156,6 +167,17 @@ if __name__ == '__main__':
# # img = img[:432,:768,]
# # show_image(frame)
# video.write(img)
min_index
=
min
(
r_frames
.
keys
())
max_index
=
max
(
r_frames
.
keys
())
for
index
in
range
(
min_index
,
max_index
+
1
):
rv
=
r_frames
.
get
(
index
,
None
)
lv
=
l_frames
.
get
(
index
,
None
)
if
rv
is
None
or
lv
is
None
:
continue
merged_list
=
[
np
.
concatenate
((
lv
[
i
],
sublist
),
axis
=
0
)
for
i
,
sublist
in
enumerate
(
rv
)]
# show_image(np.array(merged_list))
video
.
write
(
np
.
array
(
merged_list
))
print
(
"视频保存中"
)
video
.
release
()
...
...
tools/sim_video_cap.py
浏览文件 @
b318d544
...
...
@@ -11,7 +11,7 @@ import win32api
import
traceback
def
get_window_handle
(
window_name
=
"
universe_sim
"
):
def
get_window_handle
(
window_name
=
"
宇宙模拟器(universe sim)
"
):
"""
获取模拟器窗口句柄
@param window_name:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录