コンテンツにスキップ

Hue and Saturation#

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

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

機能を使用する#

色相の調整#

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

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

  1. カメラがBasler dartまたはpulseカメラの場合、ピクセルフォーマットをYCbCr422-8またはRGB8に設定します。
  2. BslHueパラメーター(dartおよびpulseカメラ:BslHueValue)の値を入力します。パラメーター値の範囲は-180°~180°です。

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

彩度の調整#

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

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

  1. カメラがBasler dartまたはpulseカメラの場合、ピクセルフォーマットをYCbCr422-8またはRGB8に設定します。
  2. BslSaturationパラメーター(dartおよびpulseカメラ:BslSaturationValue)の値を入力します。デフォルトでは、パラメーターは1(標準彩度)に設定されています。

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

追加パラメーター#

使用可能な場合は、BrslHueRawおよびBslSaturationRawパラメーターを使用して、色相パラメーターと彩度パラメーターに、浮動小数点値ではなく整数値を入力できます。通常、これらのパラメーターを設定する必要はありません。

サンプルコード#

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