跳至內容
測試伺服器
開發伺服器

Processed Raw Enable#

透過 Processed Raw Enable camera feature,當您使用 Bayer pixel format 時,能夠使用 Color Transformation 與 Color Adjustment 功能。

資訊

Processed Raw Enable 功能僅適用於以下相機型號且為必填項目:aca1280-60gc、aca1300-60gc、aca1600-60gc、aca1920-25gc、aca2000-50gc、aca2040-25gc、aca2500-14gc、aca3800-10gc

使用此功能#

啟用 Processed Raw Enable#

您僅應在同時符合下列條件時,才啟用 Processed Raw Enable 功能:

在所有其他情況下,請勿啟用此功能。否則可能會降低影像品質。

若要啟用 Processed Raw Enable 功能:

  1. 將 pixel format 設定為 Bayer pixel format,例如 Bayer 12。
  2. 將 ProcessedRawEnable 參數設為 true.

運作原理#

Color Transformation 與 Color Adjustment 功能需要以 RGB 三元組(triplets)儲存的影像資料才能運作。當使用「raw」Bayer pixel format 時,通常不會提供 RGB 三元組。相反地,每個像素僅提供紅色、綠色或藍色資料。若要計算 RGB 三元組,必須對 raw 影像資料執行去馬賽克(demosaicing)演算法。這表示必須處理 raw 影像資料。

啟用 Processed Raw Enable 時,系統會對 raw Bayer pixel 資料進行去馬賽克並轉換為 RGB 資料,讓 Color Transformation 與 Color Adjustment 功能得以運作。在此之後,修改後的像素資料會被重新轉換回 Bayer pixel data。最終輸出的 Bayer data 不再是「raw」輸出,而是「processed raw」輸出。

停用 Processed Raw Enable 且使用 Bayer pixel format 時,Color Transformation 與 Color Adjustment 功能可用,但不會產生任何效果。

範例程式碼#

// Set the pixel format to Bayer BG8
camera.PixelFormat.SetValue(PixelFormat_BayerBG8);
// Enable Processed Raw Enable
camera.ProcessedRawEnable.SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// Set the pixel format to Bayer BG8
CEnumParameter(nodemap, "PixelFormat").SetValue("BayerBG8");
// Enable Processed Raw Enable
CBooleanParameter(nodemap, "ProcessedRawEnable").SetValue(true);
// Set the pixel format to Bayer BG8
camera.Parameters[PLCamera.PixelFormat].SetValue(PLCamera.PixelFormat.BayerBG8);
// Enable Processed Raw Enable
camera.Parameters[PLCamera.ProcessedRawEnable].SetValue(true);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the pixel format to Bayer BG8 */
errRes = PylonDeviceFeatureFromString(hdev, "PixelFormat", "BayerBG8");
CHECK(errRes);
/* Enable Processed Raw Enable */
errRes = PylonDeviceSetBooleanFeature(hdev, "ProcessedRawEnable", 1);
CHECK(errRes);
# Set the pixel format to Bayer BG8
camera.PixelFormat.Value = "BayerBG8"
# Enable Processed Raw Enable
camera.ProcessedRawEnable.Value = True

您也可以使用 pylon Viewer 來輕鬆設定參數。