Basler Pylon 采集參數


Acquisition Mode

采集模式 允許用戶選擇選擇單幀或連續圖像采集。

    enum AcquisitionModeEnums { AcquisitionMode_SingleFrame, //!<Sets the acquisition mode to single frame AcquisitionMode_MultiFrame, //!<Sets the acquisition mode to multi frame AcquisitionMode_Continuous //!<Sets the acquisition mode to continuous  };

例如

  • AcquisitionMode_SingleFrame :單幀采集模式
  • AcquisitionMode_Continuous   :連續采集模式

代碼示例

// Configure single frame acquisition on the camera camera.AcquisitionMode.SetValue(AcquisitionMode_SingleFrame); // Switch on image acquisition camera.AcquisitionStart.Execute(); // The camera waits for a trigger signal. // When a Frame Start trigger signal has been received, // the camera executes an Acquisition Stop command internally. // Configure continuous image acquisition on the camera camera.AcquisitionMode.SetValue(AcquisitionMode_Continuous); // Switch on image acquisition camera.AcquisitionStart.Execute(); // The camera waits for trigger signals. // (...) // Switch off image acquisition camera.AcquisitionStop.Execute();

 

AcquisitionFrameCount

每次采集開始觸發后要采集的幀數

camera.AcquisitionFrameCount.SetValue(1);
int64_t i = camera.AcquisitionFrameCount.GetValue();

 

Trigger Selector

觸發類型選擇

    enum TriggerSelectorEnums
    {
        TriggerSelector_AcquisitionStart,  //!<Selects the acquisition start trigger for configuration
        TriggerSelector_AcquisitionEnd,  //!<Selects the acquisition end trigger for configuration
        TriggerSelector_AcquisitionActive,  //!<Selects the acquisition active trigger for configuration
        TriggerSelector_FrameStart,  //!<Selects the frame start trigger for configuration
        TriggerSelector_FrameEnd,  //!<Selects the frame end trigger for configuration
        TriggerSelector_FrameActive,  //!<Selects the frame active trigger for configuration
        TriggerSelector_LineStart,  //!<Selects the line start trigger for configuration
        TriggerSelector_ExposureStart,  //!<Selects the exposure start trigger for configuration
        TriggerSelector_ExposureEnd,  //!<Selects the exposure end trigger for configuration
        TriggerSelector_ExposureActive   //!<Selects the exposure active trigger for configuration

    };

 例如

  • TriggerSelector_FrameStart          單幅圖像
  • TriggerSelector_AcquisitionStart   多幅畫面
// Select and enable the Frame Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
camera.TriggerMode.SetValue(TriggerMode_On);
// Select and enable the Acquisition Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_AcquisitionStart);
camera.TriggerMode.SetValue(TriggerMode_On);
// Set the number of images to be acquired per Acquisition Start trigger signal to 3
camera.AcquisitionFrameCount.SetValue(3);

 

Trigger Mode

針對觸發類型的觸發模式選擇。

    enum TriggerModeEnums
    {
        TriggerMode_Off,  //!<Sets the mode for the selected trigger to off
        TriggerMode_On   //!<Sets the mode for the selected trigger to on

    };

 代碼如下

// Select the Frame Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
// Enable triggered image acquisition for the Frame Start trigger
camera.TriggerMode.SetValue(TriggerMode_On);

默認,每種觸發類型的觸發模式都被設為 OFF。也即意味着 “自由運行圖像采集” 被打開。所有的 Basle 相機默認都是自由運行圖像采集模式。

 

Free Run Image Acquisition

自由運行圖像采集模式不需要用戶觸發。這個選項不在 Pylon Viewer ,需要編程設置。

設置方式:

  1. 設置采集模式為連續 AcquisitionMode_Continuous
  2. 選擇一種觸發類型,比如 FrameStart
  3. 設置觸發模式為 OFF
  4. 重復上述步驟設置所有觸發類型

 

Trigger Source

觸發源可以選擇硬件或軟件。

    enum TriggerSourceEnums
    {
        TriggerSource_Software,  //!<Sets the software trigger as the signal source for the selected trigger
        TriggerSource_Line1,  //!<Sets the signal source for the selected trigger to line 1
        TriggerSource_Line2,  //!<Sets the signal source for the selected trigger to line 2
        TriggerSource_Line3,  //!<Sets the signal source for the selected trigger to line 3
        TriggerSource_Line4,  //!<Sets the signal source for the selected trigger to line 4
        TriggerSource_Line5,  //!<Sets the signal source for the selected trigger to line 5
        TriggerSource_Line6,  //!<Sets the signal source for the selected trigger to line 6
        TriggerSource_Line7,  //!<Sets the signal source for the selected trigger to line 7
        TriggerSource_Line8,  //!<Sets the signal source for the selected trigger to line 8
        TriggerSource_CC1,  //!<Sets the signal source for the selected trigger to CC1
        TriggerSource_CC2,  //!<Sets the signal source for the selected trigger to CC2
        TriggerSource_CC3,  //!<Sets the signal source for the selected trigger to CC3
        TriggerSource_CC4,  //!<Sets the signal source for the selected trigger to CC4
        TriggerSource_ShaftEncoderModuleOut,  //!<Sets the signal source for the selected trigger to the shaft encoder module.
        TriggerSource_FrequencyConverter,  //!<Sets the signal source for the selected trigger to the frequency converter module.
        TriggerSource_Timer1Start,  //!<Sets the signal source for the selected trigger to timer 1 start
        TriggerSource_Timer1End,  //!<Sets the signal source for the selected trigger to timer 1 end
        TriggerSource_Counter1Start,  //!<Sets the signal source for the selected trigger to counter 1 start
        TriggerSource_Counter1End,  //!<Sets the signal source for the selected trigger to counter 1 end
        TriggerSource_UserOutput1,  //!<Sets the signal source for the selected trigger to user output 1
        TriggerSource_UserOutput2,  //!<Sets the signal source for the selected trigger to user output 2
        TriggerSource_Action1,  //!<Sets the signal source for the selected trigger to action command signal 1
        TriggerSource_Action2,  //!<Sets the signal source for the selected trigger to action command signal 2
        TriggerSource_Action3,  //!<Sets the signal source for the selected trigger to action command signal 3
        TriggerSource_Action4,  //!<Sets the signal source for the selected trigger to action command signal 4
        TriggerSource_VInput1,  //!<Sets the signal source for the selected trigger to Virtual Input 1
        TriggerSource_VInput2,  //!<Sets the signal source for the selected trigger to Virtual Input 2
        TriggerSource_VInput3,  //!<Sets the signal source for the selected trigger to Virtual Input 3
        TriggerSource_VInput4,  //!<Sets the signal source for the selected trigger to Virtual Input 4
        TriggerSource_VInputDecActive   //!<Sets the signal source for the selected trigger to Virtual Input Decoder Active

    };

例如

  • TriggerSource_Software
  • TriggerSource_Line1

 

代碼示例

// Select the Frame Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
// Set the trigger source to Line 1
camera.TriggerSource.SetValue(TriggerSource_Line1);

 

Trigger Activation

指定硬件觸發時是上升沿或下降沿有效。

    enum TriggerActivationEnums
    {
        TriggerActivation_RisingEdge,  //!<Sets the selected trigger to become active on the rising edge of the source signal
        TriggerActivation_FallingEdge,  //!<Sets the selected trigger to become active on the falling edge of the source signal
        TriggerActivation_AnyEdge,  //!<Sets the selected trigger to become active on the falling or rising edge of the source signal
        TriggerActivation_LevelHigh,  //!<Sets the selected trigger to become active when  the source signal is high
        TriggerActivation_LevelLow   //!<Sets the selected trigger to become active when  the source signal is low

    };

例如:

  • TriggerActivation_RisingEdge :上升沿有效
  • TriggerActivation_FallingEdge :下降沿有效

 

代碼示例

// Select the Frame Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
// Set the trigger activation mode to rising edge
camera.TriggerActivation.SetValue(TriggerActivation_RisingEdge);

 

Trigger Software

用軟件觸發相機,設置:

  1. 設置觸發類型,比如 FrameStart
  2. 設置觸發模式為 ON
  3. 設置觸發源為 Software
  4. 執行 TriggerSoftware 命令

代碼示例

// Select the Frame Start trigger
camera.TriggerSelector.SetValue(TriggerSelector_FrameStart);
// Enable triggered image acquisition for the Frame Start trigger
camera.TriggerMode.SetValue(TriggerMode_On);
// Set the trigger source for the Frame Start trigger to Software
camera.TriggerSource.SetValue(TriggerSource_Software);
// Generate a software trigger signal
camera.TriggerSoftware.Execute();

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM