【问题标题】:Intel Realsense - unable to read bag fileIntel Realsense - 无法读取包文件
【发布时间】:2021-02-11 09:04:08
【问题描述】:

从英特尔 Realsense 摄像头 D435i,我记录了一个包文件,现在尝试读取它以获取帧,但收到以下错误消息:

RuntimeError: Couldn't Resolve requests

我正在使用 python read_bag_example.py 文件示例。

try:
    # Create pipeline
    pipeline = rs.pipeline()

    # Create a config object
    config = rs.config()
    # Tell config that we will use a recorded device from filem to be used by the pipeline through playback.
    rs.config.enable_device_from_file(config, args.input)
    # Configure the pipeline to stream the depth stream
    config.enable_stream(rs.stream.color, 1280, 720, rs.format.bgr8, 6)

    # Start streaming from file
    pipeline.start(config)

    # Create opencv window to render image in
    cv2.namedWindow("Color Stream", cv2.WINDOW_AUTOSIZE)
    

    # Streaming loop
    while True:
        # Get frameset of depth
        frames = pipeline.wait_for_frames()

        # Get depth frame
        color_frame = frames.get_color_frame()
        
        # convert frame to numpy array
        color_image = np.asanyarray(color_frame.get_data())
        cv2.imshow('Color Stream', color_image)
        key = cv2.waitKey(1)
        if key == 27:
           cv2.destroyAllWindows()
           break
finally:
   pass

注意:我录制的包文件具有 6fps 的深度和颜色流。在上面的代码中,我只对颜色流感兴趣。我假设,获取它应该不是问题。

感谢任何帮助。谢谢。

【问题讨论】:

  • 错误发生在哪一行?您的文件是在您的计算机上还是在远程服务器上?
  • @Marco 我也收到以下错误:pipeline.start(config)

标签: python intel realsense


【解决方案1】:

您可以改用 rs.format.bgr8。像这样

config.enable_stream(rs.stream.color, rs.format.rgb8, 30)

更多信息,您可以访问https://github.com/IntelRealSense/librealsense/issues/2652

【讨论】:

    猜你喜欢
    • 2017-06-03
    • 1970-01-01
    • 2020-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-23
    • 2012-01-12
    相关资源
    最近更新 更多