콘텐츠로 바로 가기
STAGING SERVER
DEVELOPMENT SERVER

Balance White#

Balance White camera feature를 사용하면 색 편차를 수동으로 보정하여 획득한 이미지에서 흰색 피사체가 흰색으로 나타나도록 할 수 있습니다.

이를 위해 컬러 채널(빨간색, 초록색, 파란색)별로 디지털 게인 보정을 적용할 수 있습니다.

색 편차를 자동으로 보정하려면 Balance White Auto 기능을 사용하십시오.

기능 사용#

화이트 밸런스 보정을 수행하는 이유#

카메라로 획득한 이미지에는 특정 색상의 색조와 같은 색 편향이 있을 수 있습니다. 그 이유는 광원마다 색온도가 다르기 때문입니다. 형광등 조명은 이미지에 푸른빛을 더하고, 텅스텐 백열등은 노란빛을 더합니다.

화이트 밸런스 기능을 사용하면 빨간색, 초록색, 파란색의 강도를 조절하여 이러한 색 편차를 보정할 수 있습니다. 그 결과, 획득한 이미지에서 흰색 피사체가 흰색으로 나타납니다.

화이트 밸런스 보정 수행하기#

화이트 밸런스 보정을 수행하려면:

  1. 파라미터를 원하는 Balance White 자동 기능을 Off.
  2. 최상의 결과를 얻으려면 black level을 0(영)으로 설정하십시오.
  3. 파라미터를 원하는 BalanceRatioSelector 파라미터를 사용 가능한 컬러 채널 중 하나로(Red, Green, 또는 Blue).
  4. 조정합니다. BalanceRatio 선택한 컬러 채널의 파라미터 값:

    • Balance ratio = 1: 색상의 강도가 변경되지 않습니다.
    • Balance ratio > 1: 다른 두 색상에 비해 색상의 강도가 증가합니다.
    • Balance ratio < 1: The intensity of the color is decreased relative to the other two colors. (This is only possible if your camera model supports balance ratio values lower than 1.)
    • 사용 가능한 모든 컬러 채널에 대해 3단계와 4단계를 반복합니다.

강도의 증가 또는 감소는 비례합니다. 예를 들어, 특정 색상의 밸런스 비율이 1.2로 설정된 경우 해당 색상의 강도가 20% 증가합니다.

정보

  • 밸런스 비율을 1 미만으로 지정하면 해당 색상이 도달할 수 있는 최대 강도도 감소합니다. 한 색상이 지나치게 우세한 현상을 보정하려는 경우가 아니라면 밸런스 비율을 1 미만으로 지정하는 것은 권장되지 않습니다.
  • Light Source Preset 또는 Color Transformation과 같은 일부 색상 향상 기능도 화이트 밸런스 설정에 영향을 미칩니다. 필요한 경우 이러한 기능을 사용한 후 화이트 밸런스를 수동으로 다시 조정할 수 있습니다.

샘플 코드#

ace Classic/U/L GigE Cameras#
// Set the red intensity to 108.789%
camera.BalanceRatioSelector.SetValue(BalanceRatioSelector_Red);
camera.BalanceRatioAbs.SetValue(1.08789);
// Set the green intensity to 100%
camera.BalanceRatioSelector.SetValue(BalanceRatioSelector_Green);
camera.BalanceRatioAbs.SetValue(1.0);
// Set the blue intensity to 219.678%
camera.BalanceRatioSelector.SetValue(BalanceRatioSelector_Blue);
camera.BalanceRatioAbs.SetValue(2.19678);
INodeMap& nodemap = camera.GetNodeMap();
// Set the red intensity to 108.789%
CEnumParameter(nodemap, "BalanceRatioSelector").SetValue("Red");
CFloatParameter(nodemap, "BalanceRatioAbs").SetValue(1.08789);
// Set the green intensity to 100%
CEnumParameter(nodemap, "BalanceRatioSelector").SetValue("Green");
CFloatParameter(nodemap, "BalanceRatioAbs").SetValue(1.0);
// Set the blue intensity to 219.678%
CEnumParameter(nodemap, "BalanceRatioSelector").SetValue("Blue");
CFloatParameter(nodemap, "BalanceRatioAbs").SetValue(2.19678);
// Set the red intensity to 108.789%
camera.Parameters[PLCamera.BalanceRatioSelector].SetValue(PLCamera.BalanceRatioSelector.Red);
camera.Parameters[PLCamera.BalanceRatioAbs].SetValue(1.08789);
// Set the green intensity to 100%
camera.Parameters[PLCamera.BalanceRatioSelector].SetValue(PLCamera.BalanceRatioSelector.Green);
camera.Parameters[PLCamera.BalanceRatioAbs].SetValue(1.0);
// Set the blue intensity to 219.678%
camera.Parameters[PLCamera.BalanceRatioSelector].SetValue(PLCamera.BalanceRatioSelector.Blue);
camera.Parameters[PLCamera.BalanceRatioAbs].SetValue(2.19678);
/* 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 red intensity to 108.789% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Red");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatioAbs", 1.08789);
CHECK(errRes);
/* Set the green intensity to 100% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Green");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatioAbs", 1.0);
CHECK(errRes);
/* Set the blue intensity to 219.678% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Blue");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatioAbs", 2.19678);
CHECK(errRes);
# Set the red intensity to 108.789%
camera.BalanceRatioSelector.Value = "Red"
camera.BalanceRatioAbs.Value = 1.08789
# Set the green intensity to 100%
camera.BalanceRatioSelector.Value = "Green"
camera.BalanceRatioAbs.Value = 1.0
# Set the blue intensity to 219.678%
camera.BalanceRatioSelector.Value = "Blue"
camera.BalanceRatioAbs.Value = 2.19678
기타 카메라#
// Set the red intensity to 108.789%
camera.BalanceRatioSelector.SetValue(BalanceRatioSelector_Red);
camera.BalanceRatio.SetValue(1.08789);
// Set the green intensity to 100%
camera.BalanceRatioSelector.SetValue(BalanceRatioSelector_Green);
camera.BalanceRatio.SetValue(1.0);
// Set the blue intensity to 219.678%
camera.BalanceRatioSelector.SetValue(BalanceRatioSelector_Blue);
camera.BalanceRatio.SetValue(2.19678);
INodeMap& nodemap = camera.GetNodeMap();
// Set the red intensity to 108.789%
CEnumParameter(nodemap, "BalanceRatioSelector").SetValue("Red");
CFloatParameter(nodemap, "BalanceRatio").SetValue(1.08789);
// Set the green intensity to 100%
CEnumParameter(nodemap, "BalanceRatioSelector").SetValue("Green");
CFloatParameter(nodemap, "BalanceRatio").SetValue(1.0);
// Set the blue intensity to 219.678%
CEnumParameter(nodemap, "BalanceRatioSelector").SetValue("Blue");
CFloatParameter(nodemap, "BalanceRatio").SetValue(2.19678);
// Set the red intensity to 108.789%
camera.Parameters[PLCamera.BalanceRatioSelector].SetValue(PLCamera.BalanceRatioSelector.Red);
camera.Parameters[PLCamera.BalanceRatio].SetValue(1.08789);
// Set the green intensity to 100%
camera.Parameters[PLCamera.BalanceRatioSelector].SetValue(PLCamera.BalanceRatioSelector.Green);
camera.Parameters[PLCamera.BalanceRatio].SetValue(1.0);
// Set the blue intensity to 219.678%
camera.Parameters[PLCamera.BalanceRatioSelector].SetValue(PLCamera.BalanceRatioSelector.Blue);
camera.Parameters[PLCamera.BalanceRatio].SetValue(2.19678);
/* 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 red intensity to 108.789% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Red");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatio", 1.08789);
CHECK(errRes);
/* Set the green intensity to 100% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Green");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatio", 1.0);
CHECK(errRes);
/* Set the blue intensity to 219.678% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Blue");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatio", 2.19678);
CHECK(errRes);
# Set the red intensity to 108.789%
camera.BalanceRatioSelector.Value = "Red"
camera.BalanceRatio.Value = 1.08789
# Set the green intensity to 100%
camera.BalanceRatioSelector.Value = "Green"
camera.BalanceRatio.Value = 1.0
# Set the blue intensity to 219.678%
camera.BalanceRatioSelector.Value = "Blue"
camera.BalanceRatio.Value = 2.19678

pylon Viewer를 사용하여 파라미터를 손쉽게 설정할 수도 있습니다.