Я пытаюсь сохранить как глубину, так и цветные изображения камеры Intel Realsense D435i в списке из 300 изображений. Затем я буду использовать многопроцессорную обработку, чтобы сохранить этот фрагмент из 300 изображений на свой диск. Но каждый раз, когда я пытаюсь, программа успешно добавляет 15 изображений в список, а затем я получаю эту ошибку:
Frame didn't arrived within 5000
Я убедился, что у меня установлена 64-битная версия на python 3.6, и камера работает отлично, когда я не пытаюсь сохранить изображения в списке. Зритель в реальном смысле тоже отлично работает. Я также пробовал с разными разрешениями и частотой кадров, но, похоже, это тоже не работает. Что интересно, если я сохраню только цветные изображения, я не получу ту же ошибку, вместо этого я снова и снова буду получать одно и то же цветное изображение в списке.
if __name__ == '__main__':
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 1280, 720, rs.format.bgr8, 30)
profile = pipeline.start(config)
depth_sensor = profile.get_device().first_depth_sensor()
depth_sensor.set_option(
rs.option.visual_preset, 3
) # Set high accuracy for depth sensor
depth_scale = depth_sensor.get_depth_scale()
align_to = rs.stream.color
align = rs.align(align_to)
# Init variables
im_count = 0
image_chunk = []
image_chunk2 = []
# sentinel = True
try:
while True:
# Wait for a coherent pair of frames: depth and color
frames = pipeline.wait_for_frames()
aligned_frames = align.process(frames)
aligned_depth_frame = aligned_frames.get_depth_frame()
color_frame = aligned_frames.get_color_frame()
if not aligned_depth_frame or not color_frame:
print("problem here")
raise RuntimeError("Could not acquire depth or color frames.")
depth_image = np.asanyarray(aligned_depth_frame.get_data())
color_image = np.asanyarray(color_frame.get_data())
image_chunk.append(color_image)
image_chunk2.append(depth_image)
except Exception as e:
print(e)
finally:
# Stop streaming
pipeline.stop()
Мне просто нужно сохранить 300 изображений подряд, вот и все, поэтому я очень обеспокоен тем, что вызывает эту проблему.
.append()
вызывает RuntimeError. Я также испытываю подобную проблему. - person Physicing   schedule 22.10.2019