コンテンツにスキップ

Processed Raw Enable#

Processed Raw Enableカメラ機能を使用すると、ベイヤーのピクセルフォーマットを使用するときにColor TransformationおよびColor Adjustmentの機能を使用できます。

機能を使用する#

Processed Raw Enableの有効化#

次の条件の両方が満たされている場合にのみ、Processed Raw Enable機能を有効にしてください。

それ以外の場合は、この機能を有効にしないでください。有効にすると、画質が低下する可能性があります。

Processed Raw Enable機能を有効にするには、次の手順に従います。

  1. ピクセルフォーマットをベイヤーのピクセルフォーマット(Bayer 12など)に設定します。
  2. Set the ProcessedRawEnable parameter to true.

仕組み#

Color TransformationおよびColor Adjustment機能を使用するには、RGBトリプレットで画像データを保存する必要があります。「raw」ベイヤーピクセルフォーマットを使用する場合、通常、RGBトリプレットは提供されません。代わりに、各画素は赤、緑、青のいずれかのデータのみを提供します。RGBトリプレットを計算するには、raw画像データに対してデモザイクアルゴリズムを実行する必要があります。つまり、raw画像データを処理する必要があります。

Processed Raw Enableを有効にすると、raw Bayer画素データがデモザイクされ、RGBデータに変換されて、Color TransformationおよびColor Adjustmentの機能が動作できるようになります。その後、変更された画素データはBayer画素データに再変換されます。最終Bayerデータ出力は「raw」出力ではなく、「加工されたraw」出力です。

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

pylon Viewerを使用して、パラメーターを簡単に設定することもできます。