コンテンツにスキップ
ステージングサーバー
開発サーバー

デモザイクモード#

Demosaicing Mode カメラ機能を使用すると、デモザイクに使用する方式を変更できます。

これにより、画質の最適化に役立ちます。

情報

この機能は、Basler ace 2、boost R、および dart R カメラで使用できます。

Basler ace U/L カメラにも DemosaicingMode パラメータが用意されていますが、これは有効にするためだけに機能します。 PGI 機能セット.

機能を使用する#

Demosaicing Mode を使用する理由#

デモザイク(デベザリングとも呼ばれます)は、イメージセンサーの色出力から RGB 情報を生成するために実行されます。

Basler カラーカメラは、Pixel Format が Bayer フォーマットに設定されている場合でも、常にデモザイクを実行します。これはカメラの内部画像処理によるものです。

カメラには、デモザイク用のさまざまな方式が用意されています。デフォルトでは、設定された Pixel Format に基づいて方式が自動的に決定されます。

自動選択された方式による結果がアプリケーションの要件を満たさない場合、Demosaicing Mode を手動で調整すると役立ちます。

たとえば、カメラは Bayer Pixel Format に対して自動的に Nearest Neighbor 方式を選択します。これは、古いファームウェアバージョンとの互換性を確保するためです。ただし、Unilinear 方式の方がより良い結果が得られることがよくあります。

デモザイク方式#

次のデモザイク方式を使用できます。

デモザイク方式 説明 非 Bayer ピクセルフォーマットに適しています Bayer ピクセルフォーマットに適しています
Average Green 最も近いピクセルのいずれかの情報、または周囲の緑色ピクセルの Arithmetic 平均を使用します。これは、PGI が利用できない場合の非 Bayer Pixel Format のデフォルト方式です。
PGI 利用可能な場合、高度なデモザイクに PGI アルゴリズムを使用します。
Nearest Neighbor 最も近いピクセルのいずれかの情報を使用します。これは Bayer Pixel Format のデフォルト方式であり、以前のファームウェアバージョンとの最高の互換性を提供します。
Unilinear 最も近いピクセルのいずれかの情報、または周囲のピクセルの Arithmetic 平均を使用します。Nearest Neighbor デモザイクと比較して、エッジでのカラーアーティファクトの発生が少なくなります。

Demosaicing Modes#

利用可能な Demosaicing Mode は以下のとおりです:

  • Auto: 設定された Pixel Format に基づいて、デモザイク処理の方法が自動的に決定されます。
  • Manual: デモザイク処理の方法を手動で設定できます。

Demosaicing の設定#

デモザイクに使用する方法を変更するには:

  1. パラメーターを BslDemosaicingMode パラメータを次のように設定: Manual.
  2. パラメーターを BslDemosaicingMethod パラメータを希望の デモザイク方法のいずれかに設定します(例: Unilinear.

サンプルコード#

// Enable manual adjustment of the demosaicing method
camera.BslDemosaicingMode.SetValue(BslDemosaicingMode_Manual);
// Set the demosaicing method to Unilinear
camera.BslDemosaicingMethod.SetValue(BslDemosaicingMethod_Unilinear);
INodeMap& nodemap = camera.GetNodeMap();
// Enable manual adjustment of the demosaicing method
CEnumParameter(nodemap, "BslDemosaicingMode").SetValue("Manual");
// Set the demosaicing method to Unilinear
CEnumParameter(nodemap, "BslDemosaicingMethod").SetValue("Unilinear");
// Enable manual adjustment of the demosaicing method
camera.Parameters[PLCamera.BslDemosaicingMode].SetValue(PLCamera.BslDemosaicingMode.Manual);
// Set the demosaicing method to Unilinear
camera.Parameters[PLCamera.BslDemosaicingMethod].SetValue(PLCamera.BslDemosaicingMethod.Unilinear);
/* 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 */
/* Enable manual adjustment of the demosaicing method */
errRes = PylonDeviceFeatureFromString(hdev, "BslDemosaicingMode", "Manual");
CHECK(errRes);
/* Set the demosaicing method to Unilinear */
errRes = PylonDeviceFeatureFromString(hdev, "BslDemosaicingMethod", "Unilinear");
CHECK(errRes);
# Enable manual adjustment of the demosaicing method
camera.BslDemosaicingMode.Value = "Manual"
# Set the demosaicing method to Unilinear
camera.BslDemosaicingMethod.Value = "Unilinear"

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