【问题标题】:Capture data from intel realsense cameras pre-trigger从英特尔实感摄像头预触发捕获数据
【发布时间】:2021-07-21 09:07:19
【问题描述】:

我希望有人可以给我一两个建议来尝试...

我正在使用 Raspberry PI 4 和英特尔 RealSense D455。我有一个外部触发器(按钮),我想在触发事件前记录(例如)5 秒并将其保存到内存(环形缓冲区)中。有没有办法用 python 和英特尔实感摄像头做到这一点。 我知道 picamera 有这个选项:https://picamera.readthedocs.io/en/latest/recipes1.html#circular-record1

如果您有任何建议,我将不胜感激。

非常感谢, 不知道

【问题讨论】:

    标签: python image-processing raspberry-pi raspberry-pi4 realsense


    【解决方案1】:

    环形缓冲区听起来类似于双端队列或双端队列。

    我没有用过你的相机,但你可以做的是不断地在一个单独的线程中记录小间隔并将它们附加到一个双端队列。一旦触发器被激活,只需保存双端队列的当前状态。

    from collections import deque
    
    clip_length = 0.1 # 100 milliseconds
    save_length = 5 # seconds
    buffer_length = save_length / clip_length    
    
    buffer = deque(maxlen=buffer_length)
    
    while True:
        clip = #record 100ms of video
        buffer.append(clip)
        
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-09-16
      • 1970-01-01
      • 1970-01-01
      • 2021-02-18
      • 2020-09-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多