![](/img/trans.png)
[英]OpenCV cv2.VideoCapture(0) is not working well with webcam
[英]cv2.VideoCapture() for IP webcam andriod
如何在 ImageAI 视频 object 检测中输入 IP 网络摄像头视频? 我的代码看起来像这样,
detector = VideoObjectDetection()
detector.setModelTypeAsYOLOv3()
detector.setModelPath(os.path.join(execution_path , "yolo.h5"))
detector.loadModel()
print('Model loaded')
capture = cv2.VideoCapture("http://10.10.1.223:8080/shot.jpg")
video_path = detector.detectObjectsFromVideo(camera_input=capture,
output_file_path=os.path.join(execution_path, "captured")
, frames_per_second=5, log_progress=True, detection_timeout=120)
当我将 cv2.VideoCapture(0) 用于笔记本电脑的网络摄像头时,连续帧会传入我的检测器并创建一个新视频,但是,每当我通过 IP 网络摄像头链接时,它只会处理一帧然后结束。
好吧,为了回答我自己的问题,我只是将 shot.jpg 从我的 URL 替换为视频。 而已!
我发现如果您从浏览器中仅访问IP,您可以通过浏览视频渲染>>浏览器来复制视频地址,只需右键单击并复制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.