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

デモザイクモード#

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

これにより、画質を最適化することができます。

情報

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

Basler ace U/L カメラも DemosaicingMode パラメータを提供しますが、これは以下を有効にするためだけに機能します。 PGI 機能セット.

機能を使用する#

Demosaicing Mode を使用する理由#

デバイヤーとも呼ばれる Demosaicing は、イメージセンサーの色出力から RGB 情報を生成するために実行されます。

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

お使いのカメラには、デモザイク用のさまざまな方法が用意されています。デフォルトでは、設定されたピクセルフォーマットに基づいて方法が自動的に決定されます。

自動選択された方法の結果がアプリケーションで満足のいくものでない場合、デモザイクモードを手動で調整すると役立ちます。

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

デモザイク方式#

次のデモザイク方法を利用できます:

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

Demosaicing Modes#

次のデモザイクモードを利用できます:

  • Auto: 設定されたピクセルフォーマットに基づいて、デモザイク方法が自動的に決定されます。
  • Manual: デモザイク方法を手動で設定できます。

デモザイクの設定#

デモザイキングに使用される方法を変更するには:

  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を使用して、パラメーターを簡単に設定することもできます。