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

Processed Raw Enable#

Processed Raw Enable 相機功能讓您能夠使用 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. 將像素格式設定為拜耳像素格式,例如拜耳 12。
  2. 將相機中的 ProcessedRawEnable 參數設為 true.

運作原理#

該 Color Transformation 以及 Color Adjustment 功能必須將影像資料儲存為 RGB 三元組才能運作。當使用「原始」拜耳像素格式時,通常不會提供 RGB 三元組。相反地,每個像素僅提供紅色、綠色或藍色其中一項資料。為了計算 RGB 三元組,必須對原始影像資料執行去馬賽克演算法。這意味著必須對原始影像資料進行處理。

當啟用Processed Raw Enable 時,原始的拜耳像素資料會經過去馬賽克處理並轉換為RGB資料,從而使 Color Transformation 及 Color Adjustment 功能得以運作。隨後,經處理的像素資料會重新轉換為拜耳像素資料。最終輸出的拜耳資料已不再是「原始」輸出,而是「經處理的原始」輸出。

當「Processed Raw Enable 」功能被停用且採用拜耳像素格式時, 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

您也可以 use the pylon Viewer 來輕鬆設定參數。