import cv2
def capture_thread(video_path, frame_buffer, lock):
print("capture_thread start")
vid = cv2.VideoCapture(video_path)
if not vid.isOpened():
raise IOError("Couldn't open webcam or video")
while True:
return_value, frame = vid.read()
if return_value is not True:
break
cv2.waitKey(25)
lock.acquire()
frame_buffer.push(frame)
lock.release()
def play_thread(frame_buffer, lock):
print("detect_thread start")
print("detect_thread frame_buffer size is", frame_buffer.size())
while True:
if frame_buffer.size() > 0:
lock.acquire()
frame = frame_buffer.pop()
lock.release()
cv2.imshow("result", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break

weixin_43409627
- 粉丝: 63
最新资源
- 实验虚拟机安装配置与通信.doc
- 中职计算机理论课程教学的探讨.docx
- 大数据时代数据安全防护最佳实践.docx
- 大数据背景下企业财务管理的挑战与对策探究.docx
- 2011年7月计算机原理试卷.doc
- 温度数据采集与无线传输系统设计.doc
- 单片机温度控制系统设计.doc
- 可编程序控制器中电工模拟试题.doc
- 试论企业档案信息化建设中的安全管控.docx
- 大数据方法与新闻传播创新:从理论定义到操作路线.docx
- 厦门哈尼贝儿童用品有限公司网络营销策略研究.doc
- 探究计算机技术在水利工程设计中的应用.docx
- 滴滴大数据离线和实时平台架构分析.docx
- 计算机学科中双语教学实践研究.docx
- 物联网对计算机通信网络的影响研究.docx
- 字处理软件常用使用技巧和习题.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


