Pattern Removal Auto#
機能を使用する#
Pattern Removal Autoを使用する理由#
一部のカメラで出力される画像には、重なったチェッカーパターンに似たアーチファクトが表示される場合があります。これは、特定のセンサー設計によるものです。センサーアレイ内の2 x 2画素は、入射がセンサーの表面に対して垂直である場合にのみ、光に対して同じように反応します。傾斜角で光が届くと、若干異なる反応を示します。これにより、画像のチェッカーパターンが生成されます。
元のピクセル値に適切な補正係数が適用されていることを確認することで、チェッカーパターンを抑制できます。補正係数は、画像取得ごとに自動的に適用されます。
Pattern Removal Autoを使用すると、補正係数の値が画像取得ごとに適切であることを確認できます。この値は、Pattern Removal Autoを使用したときに存在していた特定の撮像条件でのみ有効です。
特性#
Pattern Removal Autoオートファンクションは、他のオートファンクションとは異なる点があります。
- オートファンクションROIを指定する必要はありません。
- 目標値を指定する必要はありません。その代わりに、オートファンクションが、チェッカーパターンを可能な限り削除する補正係数値を生成します。
Once
操作モードのみ使用できます。
Enabling and Using Pattern Removal Auto#
Pattern Removal Autoオートファンクションを使用するには、次の手順に従います。
- 画像ROIを最大サイズに設定します。
- 可能であれば、均一な照明を確立します。
- 補正値の生成を妨げる可能性のあるすべてのカメラ機能(Gain Auto、Exposure Auto、Sequencerなど)を無効にします。
- Adjust the camera settings (e.g., Exposure Time, Black Level, and Digital Shift) as desired. For best results, the gray values should be homogeneous across the image.
PatternRemovalAuto
パラメーターをOnce
に設定します。- 3枚の画像を取得します。対象シーンが取得間で変化しないようにします。
カメラは現在の撮像条件に最適な補正値を生成して適用します。これは瞬時に発生し、カメラのフレームレートには影響しません。3回目の取得後、PatternRemovalAuto
パラメーターは自動的にOff
に設定されます。 - 必要に応じて、画像ROIを元のサイズに戻します。
生成された補正値は、次のいずれかのイベントが発生するまで適用されます。
Repeating the Pattern Removal Auto Process#
関連する撮像条件のいずれかが変更された場合は、Pattern Removal Autoプロセスを繰り返す必要があります。これにより、変更された条件でもチェッカーパターンが確実に削除され、ピクセル値が不必要に変更されることがなくなります。
関連する撮像条件には、次のものがあります。
- 光学系:レンズ、絞り、焦点の変更。
- 照明:照明の種類、光源の配置、明るさの変更。
- 機能設定:チェッカーパターンは、いくつかのカメラ機能、特に、Exposure Time、Binning、画像ROI、Black Level、Digital Shiftの影響を受けることがあります。
Saving the Correction Values#
カメラが電源から切断されると、Pattern Removal Autoオートファンクションによって生成された補正値は失われます。
ただし、修正値はユーザーセットに保存できます。このユーザーセットは、修正値を再度使用するときにいつでもロードできます。
補正値をロードするときは、撮像条件が、補正値が生成されたときと同じであることを確認してください。
サンプルコード#
// Set the operating mode of the Pattern Removal Auto auto function to Once
camera.PatternRemovalAuto.SetValue(PatternRemovalAuto_Once);
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
camera.UserSetSelector.SetValue(UserSetSelector_UserSet1);
camera.UserSetSave.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Set the operating mode of the Pattern Removal Auto auto function to Once
CEnumParameter(nodemap, "PatternRemovalAuto").SetValue("Once");
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
CEnumParameter(nodemap, "UserSetSelector").SetValue("UserSet1");
CCommandParameter(nodemap, "UserSetSave").Execute();
// Set the operating mode of the Pattern Removal Auto auto function to Once
camera.Parameters[PLCamera.PatternRemovalAuto].SetValue(PLCamera.PatternRemovalAuto.Once);
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
camera.Parameters[PLCamera.UserSetSelector].SetValue(PLCamera.UserSetSelector.UserSet1);
camera.Parameters[PLCamera.UserSetSave].Execute();
/* 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 operating mode of the Pattern Removal Auto auto function to Once */
errRes = PylonDeviceFeatureFromString(hdev, "PatternRemovalAuto", "Once");
CHECK(errRes);
/* Acquire three images */
/* ... */
/* (Implement your own image grabbing routine here. */
/* For example, the InstantCamera class provides the StartGrabbing() method.) */
/* ... */
/* Save the correction values in User Set 1 */
errRes = PylonDeviceFeatureFromString(hdev, "UserSetSelector", "UserSet1");
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "UserSetSave");
CHECK(errRes);
# Set the operating mode of the Pattern Removal Auto auto function to Once
camera.PatternRemovalAuto.Value = "Once"
# Acquire three images
# ...
# (Implement your own image grabbing routine here.
# For example, the InstantCamera class provides the StartGrabbing() method.)
# ...
# Save the correction values in User Set 1
camera.UserSetSelector.Value = "UserSet1"
camera.UserSetSave.Execute()
pylon Viewerを使用して、パラメーターを簡単に設定することもできます。