Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_opencv
提交
8a0281f6
S
skill_tree_opencv
项目概览
CSDN 技术社区
/
skill_tree_opencv
通知
65
Star
9
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
2
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
2
Issue
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8a0281f6
编写于
12月 08, 2021
作者:
F
feilong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add io and gui+fix2
上级
6e8f60ce
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
3 deletion
+9
-3
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/birds_concat.mp4
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/birds_concat.mp4
+0
-0
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/video_read_write.md
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/video_read_write.md
+5
-2
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/video_read_write.py
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/video_read_write.py
+4
-1
未找到文件。
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/birds_concat.mp4
浏览文件 @
8a0281f6
无法预览此类型文件
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/video_read_write.md
浏览文件 @
8a0281f6
...
...
@@ -8,7 +8,7 @@
这是合影的效果:
<object
width=
"500"
height=
"300"
data=
"./birds_concat.mp4"
></object>
基本的实现代码如下:
基本的实现代码如下
,合影每10帧采样一次
:
```
python
import
numpy
as
np
...
...
@@ -20,6 +20,7 @@ if __name__ == '__main__':
out
=
...
# TODO(You): 请在此正确创建待保存的目标mp4文件`out`
i
=
0
while
(
cap
.
isOpened
()):
ret
,
bird_frame
=
cap
.
read
()
...
...
@@ -33,7 +34,9 @@ if __name__ == '__main__':
)
cv2
.
imshow
(
'bird_concat_frame'
,
bird_concat_frame
)
out
.
write
(
bird_concat_frame
)
if
i
%
10
==
0
:
out
.
write
(
bird_concat_frame
)
i
+=
1
if
cv2
.
waitKey
(
1
)
&
0xFF
==
ord
(
'q'
):
break
...
...
data/1.OpenCV初阶/1.OpenCV基础/4.IO与GUI/video_read_write.py
浏览文件 @
8a0281f6
...
...
@@ -15,6 +15,7 @@ if __name__ == '__main__':
(
width
*
2
,
height
)
)
i
=
0
while
(
cap
.
isOpened
()):
ret
,
bird_frame
=
cap
.
read
()
...
...
@@ -28,7 +29,9 @@ if __name__ == '__main__':
)
cv2
.
imshow
(
'bird_concat_frame'
,
bird_concat_frame
)
out
.
write
(
bird_concat_frame
)
if
i
%
10
==
0
:
out
.
write
(
bird_concat_frame
)
i
+=
1
if
cv2
.
waitKey
(
1
)
&
0xFF
==
ord
(
'q'
):
break
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录