我有一个python代码,其中捕获了3个摄像机(/ dev / video0,/ dev / video1,/ dev / video2)的流。 当我运行2个摄像头时,可以获得清晰的图像和不错的fps。
每当我使用2或3个摄像头时,都会出现错误:
选择超时
请参阅代码的相关部分:
for src in rospy.get_param('~streams'):
streams.append(VideoStream(src=src).start())
time.sleep(2.0)
r = rospy.Rate(30)
while not rospy.is_shutdown():
frames = []
# grab the frames from their respective video streams
for stream in streams:
frames.append(stream.read())
# resize the frames
for idx, frame in enumerate(frames):
frames[idx] = imutils.resize(frame, width=frameSize)[crop_start:crop_end, crop_start:crop_end]
result = stitchFrames(0, frames) #simply stitches cams to one frame.
if mDebug is True:
cv2.imshow("Result", result)
key = cv2.waitKey(20)
if key == 27: # exit on ESC
break
r.sleep()
也尝试运行:
# sudo rmmod uvcvideo
# modprobe uvcvideo quirks=128 nodrop=1 timeout=6000
但还是一样。
知道我想念什么吗?有什么我可以做的优化吗?