콘텐츠로 바로 가기
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단계를 반복합니다.

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

정보

  • 밸런스 비율을 1 미만으로 지정하면 해당 색상이 도달할 수 있는 최대 강도도 감소합니다. 한 색상이 지나치게 우세한 현상을 보정하려는 경우가 아니라면 밸런스 비율을 1 미만으로 지정하는 것은 권장되지 않습니다.

샘플 코드#

// 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);

pylon Viewer를 사용하여 매개변수를 간편하게 설정할 수도 있습니다.