Intel Realsense D435 python wrapper pyrealsense.pipeline类
生活随笔
收集整理的這篇文章主要介紹了
Intel Realsense D435 python wrapper pyrealsense.pipeline类
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
pipeline.py
# encoding: utf-8 # module pyrealsense2.pyrealsense2 # from D:\Yolov3_Tensorflow\python\lib\site-packages\pyrealsense2\pyrealsense2.cp36-win_amd64.pyd # by generator 1.147 """ LibrealsenseTM Python Bindings((書籍的) 封皮)==============================Library for accessing Intel RealSenseTM cameras(用于訪問英特爾實感TM攝像頭的庫) """# imports import pybind11_builtins as __pybind11_builtinsclass pipeline(__pybind11_builtins.pybind11_object):"""The pipeline simplifies the user interaction with the device and computer vision processing modules.The class abstracts the camera configuration and streaming, and the vision modules triggering and threading.It lets the application focus on the computer vision output of the modules, or the device output data.The pipeline can manage computer vision modules, which are implemented as a processing blocks.The pipeline is the consumer of the processing block interface, while the application consumes the computer vision interface.(管道簡化了用戶與設備和計算機視覺處理模塊的交互。該類抽象了相機配置和流,以及視覺模塊觸發和線程化。它使應用程序可以專注于模塊的計算機視覺輸出或設備輸出數據。管道可以管理計算機視覺模塊,這些模塊被實現為處理模塊。管道是處理塊接口的使用者,而應用程序則使用計算機視覺接口。)"""def get_active_profile(self): # real signature unknown; restored from __doc__""" get_active_profile(self: pyrealsense2.pyrealsense2.pipeline) -> pyrealsense2.pyrealsense2.pipeline_profile """# 獲得活躍的攝像頭資料?passdef poll_for_frames(self): # real signature unknown; restored from __doc__"""poll_for_frames(self: pyrealsense2.pyrealsense2.pipeline) -> pyrealsense2.pyrealsense2.composite_frameCheck if a new set of frames is available and retrieve the latest undelivered set.The frames set includes time-synchronized frames of each enabled stream in the pipeline.The method returns without blocking the calling thread, with status of new frames available or not.If available, it fetches the latest frames set.Device frames, which were produced while the function wasn't called, are dropped.To avoid frame drops, this method should be called as fast as the device frame rate.The application can maintain the frames handles to defer processing. However, if the application maintains too long history, the device may lack memory resources to produce new frames, and the following calls to this method shall return no new frames, until resources become available.(檢查是否有新的幀集并檢索最新的未交付的幀。幀集包括管道中每個已啟用流的時間同步幀。該方法返回時不會阻塞調用線程,無論是否有新幀的狀態。如果可用,它將獲取最新的幀集。未調用函數時生成的設備幀將被丟棄。為避免丟幀,應以與設備幀速率一樣快的速度調用此方法。應用程序可以保證幀操作器以延遲處理。 但是,如果應用程序的歷史記錄過長,則設備可能會缺少產生新幀的內存資源,并且對此方法的以下調用將不返回任何新幀,直到資源可用為止。)"""passdef start(self, *args, **kwargs): # real signature unknown; restored from __doc__"""start(*args, **kwargs)Overloaded function.1. start(self: pyrealsense2.pyrealsense2.pipeline) -> pyrealsense2.pyrealsense2.pipeline_profileStart the pipeline streaming with its default configuration.The pipeline streaming loop captures samples from the device, and delivers them to the attached computer vision modules and processing blocks, according to each module requirements and threading model.During the loop execution, the application can access the camera streams by calling wait_for_frames() or poll_for_frames().The streaming loop runs until the pipeline is stopped.Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.(使用默認配置啟動流式傳輸。流水線循環從設備捕獲樣本,然后根據每個模塊的要求和線程模型,將它們傳遞到連接的計算機視覺模塊和處理模塊。在循環執行期間,應用程序可以通過調用wait_for_frames()或poll_for_frames()來訪問攝像機流。流循環一直運行到管道停止為止。僅在未啟動時才可以啟動管道。 如果已經啟動了管道,則會引發異常。)2. start(self: pyrealsense2.pyrealsense2.pipeline, config: pyrealsense2.pyrealsense2.config) -> pyrealsense2.pyrealsense2.pipeline_profileStart the pipeline streaming according to the configuraion.The pipeline streaming loop captures samples from the device, and delivers them to the attached computer vision modules and processing blocks, according to each module requirements and threading model.During the loop execution, the application can access the camera streams by calling wait_for_frames() or poll_for_frames().The streaming loop runs until the pipeline is stopped.Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.The pipeline selects and activates the device upon start, according to configuration or a default configuration.When the rs2::config is provided to the method, the pipeline tries to activate the config resolve() result.If the application requests are conflicting with pipeline computer vision modules or no matching device is available on the platform, the method fails.Available configurations and devices may change between config resolve() call and pipeline start, in case devices are connected or disconnected, or another application acquires ownership of a device.(根據配置啟動流傳輸。流水線循環從設備捕獲樣本,然后根據每個模塊的要求和線程模型,將它們傳遞到連接的計算機視覺模塊和處理模塊。在循環執行期間,應用程序可以通過調用wait_for_frames()或poll_for_frames()來訪問攝像機流。流循環一直運行到管道停止為止。僅在未啟動時才可以啟動管道。如果啟動了管道,則會引發異常。管道根據配置或默認配置在啟動時選擇并激活設備。當向方法提供rs2 :: config時,管道將嘗試激活config resolve()結果。如果應用程序請求與管道計算機視覺模塊沖突,或者平臺上沒有可用的匹配設備,則該方法失敗。如果設備連接或斷開連接,或者另一個應用程序獲得了設備的所有權,則可用的配置和設備可能會在config resolve()調用與管道啟動之間改變。)3. start(self: pyrealsense2.pyrealsense2.pipeline, callback: Callable[[pyrealsense2.pyrealsense2.frame], None]) -> pyrealsense2.pyrealsense2.pipeline_profileStart the pipeline streaming with its default configuration.The pipeline captures samples from the device, and delivers them to the provided frame callback.Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.When starting the pipeline with a callback both wait_for_frames() and poll_for_frames() will throw exception.(使用默認配置啟動流式傳輸。管道從設備捕獲樣本,并將其傳遞到提供的幀回調。(幀回調是什么鬼?!))僅在未啟動時才可以啟動管道。 如果啟動了管道,則會引發異常。當使用回調啟動管道時,wait_for_frames()和poll_for_frames()都將引發異常。)4. start(self: pyrealsense2.pyrealsense2.pipeline, config: pyrealsense2.pyrealsense2.config, callback: Callable[[pyrealsense2.pyrealsense2.frame], None]) -> pyrealsense2.pyrealsense2.pipeline_profileStart the pipeline streaming according to the configuraion.The pipeline captures samples from the device, and delivers them to the provided frame callback.Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.When starting the pipeline with a callback both wait_for_frames() and poll_for_frames() will throw exception.The pipeline selects and activates the device upon start, according to configuration or a default configuration.When the rs2::config is provided to the method, the pipeline tries to activate the config resolve() result.If the application requests are conflicting with pipeline computer vision modules or no matching device is available on the platform, the method fails.Available configurations and devices may change between config resolve() call and pipeline start, in case devices are connected or disconnected, or another application acquires ownership of a device.(根據配置啟動流傳輸。管道從設備捕獲樣本,并將其傳遞到提供的幀回調。僅在未啟動時才可以啟動管道。如果啟動了管道,則會引發異常。當使用回調啟動管道時,wait_for_frames()和poll_for_frames()都將引發異常。(frame callback到底是啥?)管道根據配置或默認配置在啟動時選擇并激活設備。當向方法提供rs2 :: config時,管道將嘗試激活config resolve()結果。如果應用程序請求與管道計算機視覺模塊沖突,或者平臺上沒有可用的匹配設備,則該方法失敗。如果設備連接或斷開連接,或者另一個應用程序獲得了設備的所有權,則可用的配置和設備可能會在config resolve()調用與管道啟動之間改變。)5. start(self: pyrealsense2.pyrealsense2.pipeline, queue: pyrealsense2.pyrealsense2.frame_queue) -> pyrealsense2.pyrealsense2.pipeline_profileStart the pipeline streaming with its default configuration.The pipeline captures samples from the device, and delivers them to the provided frame queue.Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.When starting the pipeline with a callback both wait_for_frames() and poll_for_frames() will throw exception.(使用默認配置啟動流式傳輸。管道從設備捕獲樣本,并將其傳遞到提供的幀隊列。僅在未啟動時才可以啟動管道。 如果啟動了管道,則會引發異常。當使用回調啟動管道時,wait_for_frames()和poll_for_frames()都將引發異常。)6. start(self: pyrealsense2.pyrealsense2.pipeline, config: pyrealsense2.pyrealsense2.config, queue: pyrealsense2.pyrealsense2.frame_queue) -> pyrealsense2.pyrealsense2.pipeline_profileStart the pipeline streaming according to the configuraion.The pipeline captures samples from the device, and delivers them to the provided frame queue.Starting the pipeline is possible only when it is not started. If the pipeline was started, an exception is raised.When starting the pipeline with a callback both wait_for_frames() and poll_for_frames() will throw exception.The pipeline selects and activates the device upon start, according to configuration or a default configuration.When the rs2::config is provided to the method, the pipeline tries to activate the config resolve() result.If the application requests are conflicting with pipeline computer vision modules or no matching device is available on the platform, the method fails.Available configurations and devices may change between config resolve() call and pipeline start, in case devices are connected or disconnected, or another application acquires ownership of a device.(根據配置啟動流傳輸。管道從設備捕獲樣本,并將其傳遞到提供的幀隊列。僅在未啟動時才可以啟動管道。如果啟動了管道,則會引發異常。當使用回調啟動管道時,wait_for_frames()和poll_for_frames()都將引發異常。管道根據配置或默認配置在啟動時選擇并激活設備。當向方法提供rs2 :: config時,管道將嘗試激活config resolve()結果。如果應用程序請求與管道計算機視覺模塊沖突,或者平臺上沒有可用的匹配設備,則該方法失敗。如果設備連接或斷開連接,或者另一個應用程序獲得了設備的所有權,則可用的配置和設備可能會在config resolve()調用與管道啟動之間改變。)"""passdef stop(self): # real signature unknown; restored from __doc__"""stop(self: pyrealsense2.pyrealsense2.pipeline) -> NoneStop the pipeline streaming.The pipeline stops delivering samples to the attached computer vision modules and processing blocks, stops the device streaming and releases the device resources used by the pipeline. It is the application's responsibility to release any frame reference it owns.The method takes effect only after start() was called, otherwise an exception is raised.(停止管道流。管道停止將樣本傳送到連接的計算機視覺模塊和處理模塊,停止設備流傳輸并釋放管道使用的設備資源。 應用程序有責任釋放其擁有的任何參考的幀。該方法僅在調用start()之后生效,否則引發異常。)"""passdef try_wait_for_frames(self, timeout_ms=5000): # real signature unknown; restored from __doc__""" try_wait_for_frames(self: pyrealsense2.pyrealsense2.pipeline, timeout_ms: int=5000) -> Tuple[bool, pyrealsense2.pyrealsense2.composite_frame] """passdef wait_for_frames(self, timeout_ms=5000): # real signature unknown; restored from __doc__"""wait_for_frames(self: pyrealsense2.pyrealsense2.pipeline, timeout_ms: int=5000) -> pyrealsense2.pyrealsense2.composite_frameWait until a new set of frames becomes available.The frames set includes time-synchronized frames of each enabled stream in the pipeline.In case of different frame rates of the streams, the frames set include a matching frame of the slow stream, which may have been included in previous frames set.The method blocks the calling thread, and fetches the latest unread frames set.Device frames, which were produced while the function wasn't called, are dropped. To avoid frame drops, this method should be called as fast as the device frame rate.The application can maintain the frames handles to defer processing. However, if the application maintains too long history, the device may lack memory resources to produce new frames, and the following call to this method shall fail to retrieve new frames, until resources become available.(等到新的一組幀集可用為止。幀集包括管道中每個已啟用流的時間同步幀。在流的幀率不同的情況下,幀集合包括慢流的匹配幀,該慢幀的匹配幀可能已經包括在先前的幀集合中。該方法阻止調用線程,并獲取最新的未讀幀集。未調用函數時設備生成的幀將被丟棄。 為避免丟幀,應以與設備幀速率一樣快的速度調用此方法。應用程序可以保證幀句柄以延遲處理。 但是,如果應用程序的歷史記錄過長,則設備可能會缺少產生新幀的內存資源,并且對該方法的后續調用將無法檢索新幀,直到資源可用為止。)"""passdef __init__(self, ctx, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__ """__init__(self: pyrealsense2.pyrealsense2.pipeline, ctx: pyrealsense2.pyrealsense2.context=<pyrealsense2.pyrealsense2.context object at 0x000001BDAADCA688>) -> NoneThe caller can provide a context created by the application, usually for playback or testing purposes.(調用者可以提供由應用程序創建的上下文,通常用于回放或測試目的。)"""pass總結
以上是生活随笔為你收集整理的Intel Realsense D435 python wrapper pyrealsense.pipeline类的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Intel Realsense D435
- 下一篇: python中的类与对象