python cv release_Python cv.GetSize方法代码示例
# 需要导入模块: import cv [as 别名]
# 或者: from cv import GetSize [as 别名]
def FPV_thread():
global camera_index
global capture
global WINDOW_NAME
global latest_frame
global FPV_thread_stop
global overlay_message # shared with application return results
global face_position # shared with application return results
FPV_init()
cv.NamedWindow(WINDOW_NAME, cv.CV_WINDOW_NORMAL)
cv.MoveWindow(WINDOW_NAME, 0, 0)
width_scale = 1.0
height_scale = 1.0
while True:
frame = cv.QueryFrame(capture)
cv.Flip(frame, None, 1)
#copy to buffer
frame_lock.acquire()
original_imagesize = (0,0)
resized_imagesize = (0,0)
if not latest_frame:
latest_frame = cv.CreateImage((640, 480), frame.depth, frame.nChannels)
original_imagesize = cv.GetSize(frame)
resized_imagesize = cv.GetSize(latest_frame)
width_scale = original_imagesize[0]*1.0/resized_imagesize[0]
height_scale = original_imagesize[1]*1.0/resized_imagesize[1]
cv.Resize(frame, latest_frame)
frame_lock.release()
#Display Result
text_start_point = (10, 50)
cv.PutText(frame, overlay_message, text_start_point, font, cv.Scalar(255,255,255))
cv.Rectangle(frame, text_start_point, (original_imagesize[0], 100), cv.Scalar(0,0,0), thickness=cv.CV_FILLED)
if face_position[0] > 0.0:
point1 = (int(face_position[0]*width_scale), int(face_position[1]*height_scale))
point2 = (int((face_position[0] + face_position[2])*width_scale), \
int((face_position[1]+face_position[3])*height_scale))
cv.Rectangle(frame, point1, point2, \
cv.Scalar(255, 255, 255), thickness=2)
cv.ShowImage(WINDOW_NAME, frame)
cv.ResizeWindow(WINDOW_NAME, 200, 100)
cv.NamedWindow(WINDOW_NAME, cv.CV_WINDOW_NORMAL);
cv.SetWindowProperty(WINDOW_NAME, 0, cv.CV_WINDOW_FULLSCREEN);
c = cv.WaitKey(10)
if c == ord('q'):
break
print "[INFO] FPV Thread is finished"
FPV_thread_stop = True
FPV_close()
python cv release_Python cv.GetSize方法代码示例相关推荐
- python args keargs_Python metrics.silhouette_score方法代码示例
本文整理汇总了Python中sklearn.metrics.silhouette_score方法的典型用法代码示例.如果您正苦于以下问题:Python metrics.silhouette_score ...
- python cv2 imwrite_Python cv2.imwrite方法代码示例
本文整理汇总了Python中cv2.imwrite方法的典型用法代码示例.如果您正苦于以下问题:Python cv2.imwrite方法的具体用法?Python cv2.imwrite怎么用?Pyth ...
- doc python 颜色_Python wordcloud.ImageColorGenerator方法代码示例
本文整理汇总了Python中wordcloud.ImageColorGenerator方法的典型用法代码示例.如果您正苦于以下问题:Python wordcloud.ImageColorGenerat ...
- python asyncio future_Python asyncio.isfuture方法代码示例
本文整理汇总了Python中asyncio.isfuture方法的典型用法代码示例.如果您正苦于以下问题:Python asyncio.isfuture方法的具体用法?Python asyncio.i ...
- python operator __gt___Python operator.gt方法代码示例
本文整理汇总了Python中operator.gt方法的典型用法代码示例.如果您正苦于以下问题:Python operator.gt方法的具体用法?Python operator.gt怎么用?Pyth ...
- python socket connection_Python socket.create_connection方法代码示例
本文整理汇总了Python中gevent.socket.create_connection方法的典型用法代码示例.如果您正苦于以下问题:Python socket.create_connection方 ...
- python中shelf_Python cmds.shelfLayout方法代码示例
本文整理汇总了Python中maya.cmds.shelfLayout方法的典型用法代码示例.如果您正苦于以下问题:Python cmds.shelfLayout方法的具体用法?Python cmds ...
- python中summary_Python summary_pb2.Summary方法代码示例
本文整理汇总了Python中tensorflow.core.framework.summary_pb2.Summary方法的典型用法代码示例.如果您正苦于以下问题:Python summary_pb2 ...
- python cpu count_Python multiprocessing.cpu_count方法代码示例
本文整理汇总了Python中multiprocessing.cpu_count方法的典型用法代码示例.如果您正苦于以下问题:Python multiprocessing.cpu_count方法的具体用 ...
- python socket send_Python socket.send方法代码示例
本文整理汇总了Python中socket.send方法的典型用法代码示例.如果您正苦于以下问题:Python socket.send方法的具体用法?Python socket.send怎么用?Pyth ...
最新文章
- 强强联合!Papers with Code携手arXiv,上传论文、提交代码一步到位
- centos6.8 安装nginx
- 脑机互动可提高行动能力
- (自已看的东西)java通过get和post直接提交
- 安卓自定义View进阶-分类与流程
- python fromhex_Python hexstring-list-str之间的转换方法
- 做word计算机海报图片,使用word制作宣传海报
- JIRA带来的管理思路
- linux系统怎么拨号上网,在linux中如何拨号上网?
- 【图灵学院02】大型互联网技术之数据库分库分表
- 2020有道翻译 使用付费api
- Android Google Services Framework Google Play
- 《“人工智能”主题论坛》学习笔记(一)
- 科技无障碍盛会举办,人工智能和创新成为高频词
- 【科创人独家】阿拉丁史文禄:恐惧于确定的未来,小程序年内将迎来爆发
- SpringBoot中级
- 排球计分系统java_排球计分系统|网世技术排球计分系统下载v1.0官方版 - 欧普软件下载...
- 计算机控制系统直流电机闭环调速实验,4.14直流电机闭环调速实验.pdf
- Centos7:给/dev/mapper/cl-root分区扩容
- 分布式系统的容错性(二)——检错和纠错