python-3.x - 使用python控制平移倾斜和变焦相机
问题描述
我试过控制 PTZ camera pro 2,但视频流和云台仍然不能一起工作。也许有人可以解决这个问题。欢迎反馈和建议。
这是使用python语言控制云台摄像机的完整代码。 https://github.com/deviraanggi/Logitech-PTZ-Pro-2-Control
蟒蛇3
from ctypes import *
import time
import ctypes
import clr
import os
import sys
import cv2
import PTZ
import clr
clr.AddReference('cobabikindll')
import PTZ
from PTZ import PTZDevicess, PTZType
device = PTZDevicess.GetDevice("PTZ Pro 2", PTZType.Absolute);
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',gray)
#device.Move(-1, 1)
device.MoveInternal(30,35)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
解决方案
推荐阅读
- .net - 登录身份服务器后无法重定向回角度客户端
- python - 连接到 Fargate 上的端口
- websocket - Rails: Action cable 什么时候取消订阅?
- javascript - 在节点 14.7 客户端 JavaScript 中导入失败
- memory-leaks - JavaParser 3.16.1 使用 LexicalPreservingPrinter.setup 泄漏内存
- flutter - 无法在颤动中设置状态
- c# - 在 ContentPage- ASP.NET 上设置标签值
- python - 无法发送
通过串口与实验室机器通信? - amd-gpu - 了解 AMD GPU 中的 oneAPI 和 SYCL
- rest - 如何将内容范围标头包含到来自逻辑应用程序的 http 请求中?