[使用python控制平移倾斜和变焦相机

问题描述 投票:1回答:1

我已经尝试过控制PTZ摄影机专业版2,但是视频流和云台倾斜仍然无法一起使用。也许有人可以解决这个问题。欢迎反馈和建议。

这是使用python语言控制PTZ摄像机的完整代码。https://github.com/deviraanggi/Logitech-PTZ-Pro-2-Control

python3

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()
python-3.x image-processing camera python-multithreading logitech
1个回答
0
投票

我也想做一个类似的项目。可以和我分享GitHub代码吗?链接已删除,我无法获取。

© www.soinside.com 2019 - 2024. All rights reserved.