diff --git "a/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/birds_concat.mp4" "b/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/birds_concat.mp4" index ef911ca7848d0a5d451cfd34f30f5d8a10ca172e..efd897df50ea7ed6f2f3c075e656b4bda5c03cf3 100644 Binary files "a/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/birds_concat.mp4" and "b/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/birds_concat.mp4" differ diff --git "a/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.md" "b/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.md" index 13d7118710891c102127b4628bc1637ee9e41af0..e63ec94d393f851548ba9e3110f5cc8b8cc46c1d 100644 --- "a/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.md" +++ "b/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.md" @@ -8,7 +8,7 @@ 这是合影的效果: -基本的实现代码如下: +基本的实现代码如下,合影每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 diff --git "a/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.py" "b/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.py" index 655b4476ac03196fd4248f4d4406f3cc013f60e1..1bd7079a2a3ee2ee08f0a3aaac5f4ab442b2e62b 100644 --- "a/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.py" +++ "b/data/1.OpenCV\345\210\235\351\230\266/1.OpenCV\345\237\272\347\241\200/4.IO\344\270\216GUI/video_read_write.py" @@ -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