コンテンツにスキップ

Hue and Saturation#

Hue and Saturationカメラ機能を使用すると、画像内のすべてのカラーの見栄えを1つの手順で調整できます。

画像内の個々のカラーの見栄えを調整する場合は、Color Adjustment機能を使用します(使用可能な場合)。

機能を使用する#

色相の調整#

色相を調整すると、画像の色がシフトします。これは、例えば、カラーシフトを修正したり、偽色画像を作成したりする場合に便利です。

色相を調整するには、次の手順に従います。

  1. If your camera is a Basler dart or pulse camera, set the pixel format to YCbCr422-8 or RGB8.
  2. Enter a value for the BslHue parameter (dart and pulse cameras: BslHueValue). The parameter's value range is -180° to 180°.

パラメーター値は、RGBカラーキューブの回転を参照します。デフォルトでは、このパラメーターは0°(カラーシフトなし)に設定されています。

彩度の調整#

彩度を調整すると、色の鮮やかさ(輝度)が変わります。例えば、彩度を高くすると、色を区別しやすくなります。

彩度を調整するには、次の手順に従います。

  1. If your camera is a Basler dart or pulse camera, set the pixel format to YCbCr422-8 or RGB8.
  2. Enter a value for the BslSaturation parameter (dart and pulse cameras: BslSaturationValue) . By default, the parameter is set to 1 (normal saturation).

パラメーター値を小さくすると、グレーに近い落ち着いた色になります。パラメーター値を大きくすると、より鮮明で生き生きとした色になります。

追加パラメーター#

If available, the BslHueRaw and BslSaturationRaw parameters allow you to enter integer values instead of float values for the hue and saturation parameters. Normally, you don't need to set these parameters.

サンプルコード#

dartおよびpulseカメラ#
// Set the Hue parameter to 5 degrees
camera.BslHueValue.SetValue(5);
// Set the Saturation parameter to 1.4
camera.BslSaturationValue.SetValue(1.4);
INodeMap& nodemap = camera.GetNodeMap();
// Set the Hue parameter to 5 degrees
CIntegerParameter(nodemap, "BslHueValue").SetValue(5);
// Set the Saturation parameter to 1.4
CFloatParameter(nodemap, "BslSaturationValue").SetValue(1.4);
// Set the Hue parameter to 5 degrees
camera.Parameters[PLCamera.BslHueValue].SetValue(5);
// Set the Saturation parameter to 1.4
camera.Parameters[PLCamera.BslSaturationValue].SetValue(1.4);
/* 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 Hue parameter to 5 degrees */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslHueValue", 5);
CHECK(errRes);
/* Set the Saturation parameter to 1.4 */
errRes = PylonDeviceSetFloatFeature(hdev, "BslSaturationValue", 1.4);
CHECK(errRes);
# Set the Hue parameter to 5 degrees
camera.BslHueValue.Value = 5
# Set the Saturation parameter to 1.4
camera.BslSaturationValue.Value = 1.4
その他のカメラ#
// Set the Hue parameter to 5 degrees
camera.BslHue.SetValue(5);
// Set the Saturation parameter to 1.4
camera.BslSaturation.SetValue(1.4);
INodeMap& nodemap = camera.GetNodeMap();
// Set the Hue parameter to 5 degrees
CIntegerParameter(nodemap, "BslHue").SetValue(5);
// Set the Saturation parameter to 1.4
CFloatParameter(nodemap, "BslSaturation").SetValue(1.4);
// Set the Hue parameter to 5 degrees
camera.Parameters[PLCamera.BslHue].SetValue(5);
// Set the Saturation parameter to 1.4
camera.Parameters[PLCamera.BslSaturation].SetValue(1.4);
/* 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 Hue parameter to 5 degrees */
errRes = PylonDeviceSetIntegerFeature(hdev, "BslHue", 5);
CHECK(errRes);
/* Set the Saturation parameter to 1.4 */
errRes = PylonDeviceSetFloatFeature(hdev, "BslSaturation", 1.4);
CHECK(errRes);
# Set the Hue parameter to 5 degrees
camera.BslHue.Value = 5
# Set the Saturation parameter to 1.4
camera.BslSaturation.Value = 1.4

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