コンテンツにスキップ

Line Pitch#

Line Pitchカメラ機能を使用すると、ピクセルラインあたりの送信バイト数を増やすことができます。ラインピッチを増やすために、カメラはすべてのラインにゼロ化されたバイトを追加します。

この機能は、画像データを固定サイズの数字グループに整列させる場合に便利です。例えば、4バイト(32ビット)や8バイト(64ビット)のワードに整列させる場合などです。データ整列によりパフォーマンスを向上させることができます。

機能を使用する#

仕組み#

画素データは、センサーからラインごとに読み取られます。画像ラインごとに、使用される画像ROIの幅とピクセルフォーマットに応じて、カメラは特定のバイト数を送信します。

Line Pitch機能を使用すると、1ラインあたりの送信バイト数を増やすことができます。ラインピッチを増やすために、カメラは各ラインに0化したバイトを追加します。これにより、画像データを4バイトのワードや8バイトのワードなどに揃えることができます。

例:画像ROIを250画素の幅に設定し、ピクセルフォーマットをMono 8に設定した場合、1ラインあたりの送信画素データ量は250バイト(250画素 x 8ビット深度 = 250バイト)になります。

250は4または8の倍数ではないため、このデータを4バイトまたは8バイトのワードに揃えることはできません。画像データを4バイトのワードに揃えるには、ラインのピッチを250バイトから最低252バイトに増やす必要があります(252は4の次の倍数)。画像データを8バイトのワードに揃えるには、ラインピッチを最低256バイトに増やす必要があります。

情報

データチャンクが有効な場合、ラインピッチを調整してもチャンクデータには影響しません。ゼロは、チャンクデータではなく、画像データにのみ追加されます。

Line Pitchの確認#

To determine the current line pitch, get the value of the LinePitch parameter.

This always returns the current line pitch in bytes, regardless of the LinePitchEnable parameter setting.

Setting the Line Pitch, Aligning Image Data to 4-Byte Words#

画像データを4バイトのワードに揃えるには次の手順に従います。

  1. ピクセルフォーマットを、パックされた12ビットピクセルフォーマット(Mono 12pやBayer 12pなど)以外の任意のフォーマットに設定します。
  2. Set the LinePitchEnable parameter to true.

現在のラインピッチが4の倍数でない場合、ラインピッチは自動的に次の4の倍数に設定されます。これで画像データが4バイトのワード(32ビットのワード)に整列されます。

Setting the Line Pitch, Aligning Image Data to Any Word Size#

ラインピッチを設定し、画像データを任意のワードサイズに揃えるには、次の手順に従います。

  1. ピクセルフォーマットを、パックされた12ビットピクセルフォーマット(Mono 12pやBayer 12pなど)以外の任意のフォーマットに設定します。
  2. Set the LinePitchEnable parameter to true.
    If the current line pitch is not a multiple of four, the line pitch is automatically set to the next multiple of four.
  3. Get the value of the LinePitch parameter.
    This returns the minimum possible value for the line pitch adjustment.
  4. Set the LinePitch parameter to the desired value.
    For a 4-byte, 8-byte, 16-byte, etc. word alignment, set the parameter value to the next multiple of 4, 8, 16, etc., starting at the minimum possible value determined in step 2. Example: If the value determined in step 2 is 252 and you want to align the image data to 8-byte words, set the LinePitch parameter to 256 (= the next multiple of 8).

サンプルコード#

// Enable the line pitch feature
camera.LinePitchEnable.SetValue(true);
// Get the current line pitch
int64_t i = camera.LinePitch.GetValue();
// Set the Line Pitch parameter value to the next multiple of 8
camera.LinePitch.SetValue(((i+7)/8)*8);

このサンプルコードは、C++言語でのみ使用できます。

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