콘텐츠로 건너뛰기
STAGING SERVER
DEVELOPMENT SERVER

Balance White (dart E)#

Balance White 카메라 기능을 사용하면 색상 편차를 수동으로 보정하여 획득한 이미지에서 흰색 물체가 흰색으로 나타나도록 할 수 있습니다.

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

기능 사용법#

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

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

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

화이트 밸런스 보정 수행#

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

  1. 다음 값 중 하나로 BalanceRatioSelector 파라미터를 사용 가능한 색 채널 중 하나로(Red, Green, 또는 Blue).
  2. 조절합니다. 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. 사용 가능한 모든 컬러 채널에 대해 1단계와 2단계를 반복합니다.

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

정보

  • 1보다 낮은 balance ratio를 지정하면 색상이 달성할 수 있는 최대 강도도 감소합니다. 특정 색상이 지나치게 우세한 현상을 보정하려는 경우가 아니라면 1 미만의 balance ratio를 지정하는 것은 권장되지 않습니다.

샘플 코드#

// 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);
// 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");
CIntegerParameter(nodemap, "BalanceRatio").SetValue(1);
// 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);
// 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 = PylonDeviceSetIntegerFeature(hdev, "BalanceRatio", 1);
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
# Set the blue intensity to 219.678%
camera.BalanceRatioSelector.Value = "Blue"
camera.BalanceRatio.Value = 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 = PylonDeviceSetIntegerFeature(hdev, "BalanceRatio", 1);
CHECK(errRes);
/* Set the blue intensity to 219.678% */
errRes = PylonDeviceFeatureFromString(hdev, "BalanceRatioSelector", "Blue");
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "BalanceRatio", 2.19678);
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.