Gain Auto#
자동 기능을 위한 픽셀 데이터는 하나 또는 여러 개의 auto function ROI에서 가져올 수 있습니다.
Gain Auto와 Exposure Auto를 동시에 사용하려면 Auto Function Profile 기능을 사용하여 두 기능의 효과가 균형을 이루는 방식을 지정하십시오.
gain을 수동으로 조절하려면 Gain 기능을 사용하십시오.
기능 사용법#
Gain Auto 활성화 또는 비활성화#
Gain Auto 자동 기능을 활성화 또는 비활성화하려면:
- 적어도 하나의 auto function ROI를 Gain Auto 자동 기능에 Assign합니다.
auto function ROI가 Image ROI와 부분적으로 또는 완전히 overlaps하는지 확인하십시오. - 다음 값 중 하나로
GainAuto매개변수를 다음 Operating Mode 중 하나로 설정합니다.Once: 카메라는 지정된 목표 밝기 값 에 도달할 때까지 gain을 조절합니다. 이 목표에 도달하거나 최대 30회의 계산 주기가 지난 후, 카메라는 자동 기능을 [Off]로 설정하고 마지막 계산에서 산출된 gain을 이후의 모든 이미지에 적용합니다.Continuous: 이미지가 취득되는 동안 카메라는 계속해서 gain을 조절합니다.Off: Gain Auto 자동 기능을 비활성화합니다. gain은 마지막 자동 또는 수동 조절 결과로 얻은 값으로 유지됩니다.
정보
카메라가 이미지를 연속적으로 캡처할 때 자동 기능은 약간의 지연과 함께 적용됩니다. 처음 몇 장의 이미지는 자동 기능의 영향을 받지 않을 수 있습니다.
하한 및 상한 지정#
자동 기능은 Gain 파라미터 값은 사용자가 지정한 제한 범위 내에 있습니다.
제한 범위를 변경하려면, 해당 AutoGainLowerLimit 그리고 다음을 설정하십시오: AutoGainUpperLimit 파라미터를 원하는 값으로 설정하십시오.
예: 예를 들어, AutoGainLowerLimit 파라미터를 2로 설정하고 AutoGainUpperLimit 파라미터를 6으로 설정했다고 가정해 보겠습니다. 자동 조절 프로세스 중에 gain은 2보다 낮아지지 않고 6보다 높아지지 않습니다.
목표 밝기 값 지정#
자동 기능은 목표 밝기 값, 즉 평균 회색조 값에 도달할 때까지 gain을 조절합니다.
목표 값을 지정하려면 다음을 사용하십시오. AutoTargetBrightness 파라미터.
정보
- 목표 값 계산에는 Gamma와 같은 다른 이미지 최적화가 포함되지 않습니다. 설정된 이미지 최적화에 따라 카메라에서 출력되는 이미지의 평균 회색 값은 목표 값보다 현저히 낮거나 높을 수 있습니다.
- 카메라는 또한 다음을 사용합니다.
AutoTargetBrightness매개변수를 사용하여 다음을 제어합니다. Exposure Auto 자동 기능입니다. Gain Auto를 사용하려면 Exposure Auto at the same time, use the Auto Function Profile feature to specify how the effects of both are balanced. - CXP 인터페이스가 탑재된 racer 2 S 라인 스캔 카메라의 경우 다음 사항이 적용됩니다.
목표 밝기 값을 생성하는 알고리즘은 "카메라 측"에서 적용되므로 전체 프레임이 아닌 단일 라인에만 적용됩니다. 전체 프레임은 프레임 그래버에서 구축되며, 여기서 목표 밝기 값이 적용된 임의로 선택된 라인들이 조립된 프레임의 일부가 됩니다. - 일부 카메라 모델에서는 Remove Parameter Limits 기능을 사용하여 목표 값 파라미터 제한을 늘릴 수 있습니다.
Basler ace GigE 카메라 모델에서는 Gray Value Adjustment Damping 팩터를 지정할 수도 있습니다. Basler dart 및 pulse 카메라 모델에서는 Brightness Adjustment Damping 팩터를 지정할 수 있습니다.
댐핑 팩터를 사용하면 목표 값에 더 천천히 도달하게 됩니다.
샘플 코드#
ace Classic/U/L GigE 카메라#
// Set the the Gain Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoGainRawLowerLimit.GetMin();
double maxUpperLimit = camera.AutoGainRawUpperLimit.GetMax();
camera.AutoGainRawLowerLimit.SetValue(minLowerLimit);
camera.AutoGainRawUpperLimit.SetValue(maxUpperLimit);
// Specify the target value
camera.AutoTargetValue.SetValue(150);
// Select auto function ROI 1
camera.AutoFunctionAOISelector.SetValue(AutoFunctionAOISelector_AOI1);
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.AutoFunctionAOIUsageIntensity.SetValue(true);
// Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the the Gain Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatParameter(nodemap, "AutoGainRawLowerLimit").GetMin();
double maxUpperLimit = CFloatParameter(nodemap, "AutoGainRawUpperLimit").GetMax();
CFloatParameter(nodemap, "AutoGainRawLowerLimit").SetValue(minLowerLimit);
CFloatParameter(nodemap, "AutoGainRawUpperLimit").SetValue(maxUpperLimit);
// Specify the target value
CIntegerParameter(nodemap, "AutoTargetValue").SetValue(150);
// Select auto function ROI 1
CEnumParameter(nodemap, "AutoFunctionAOISelector").SetValue("AOI1");
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanParameter(nodemap, "AutoFunctionAOIUsageIntensity").SetValue(true);
// Enable Gain Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
// Set the the Gain Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoGainRawLowerLimit].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoGainRawUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoGainRawLowerLimit].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoGainRawUpperLimit].SetValue(maxUpperLimit);
// Specify the target value
camera.Parameters[PLCamera.AutoTargetValue].SetValue(150);
// Select auto function ROI 1
camera.Parameters[PLCamera.AutoFunctionAOISelector].SetValue(PLCamera.AutoFunctionAOISelector.AOI1);
// Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.Parameters[PLCamera.AutoFunctionAOIUsageIntensity].SetValue(true);
// Enable Gain Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
/* 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 */
double minLowerLimit = 0;
double maxUpperLimit = 0;
/* Set the the Gain Auto auto function to its minimum lower limit */
/* and its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMin(hdev, "AutoGainRawLowerLimit", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoGainRawUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoGainRawLowerLimit", minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoGainRawUpperLimit", maxUpperLimit);
CHECK(errRes);
/* Specify the target value */
errRes = PylonDeviceSetIntegerFeature(hdev, "AutoTargetValue", 150);
CHECK(errRes);
/* Select auto function ROI 1 */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionAOISelector", "AOI1");
CHECK(errRes);
/* Enable the 'Intensity' auto function (Gain Auto + Exposure Auto) */
/* for the auto function ROI selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "AutoFunctionAOIUsageIntensity", 1);
CHECK(errRes);
/* Enable Gain Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
# Set the the Gain Auto auto function to its minimum lower limit
# and its maximum upper limit
minLowerLimit = camera.AutoGainRawLowerLimit.Min
maxUpperLimit = camera.AutoGainRawUpperLimit.Max
camera.AutoGainRawLowerLimit.Value = minLowerLimit
camera.AutoGainRawUpperLimit.Value = maxUpperLimit
# Specify the target value
camera.AutoTargetValue.Value = 150
# Select auto function ROI 1
camera.AutoFunctionAOISelector.Value = "AOI1"
# Enable the 'Intensity' auto function (Gain Auto + Exposure Auto)
# for the auto function ROI selected
camera.AutoFunctionAOIUsageIntensity.Value = True
# Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.Value = "Continuous"
기타 카메라#
// Set the the Gain Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.AutoGainLowerLimit.GetMin();
double maxUpperLimit = camera.AutoGainUpperLimit.GetMax();
camera.AutoGainLowerLimit.SetValue(minLowerLimit);
camera.AutoGainUpperLimit.SetValue(maxUpperLimit);
// Specify the target value
camera.AutoTargetBrightness.SetValue(0.6);
// Select auto function ROI 1
camera.AutoFunctionROISelector.SetValue(AutoFunctionROISelector_ROI1);
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.AutoFunctionROIUseBrightness.SetValue(true);
// Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.SetValue(GainAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Set the the Gain Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = CFloatParameter(nodemap, "AutoGainLowerLimit").GetMin();
double maxUpperLimit = CFloatParameter(nodemap, "AutoGainUpperLimit").GetMax();
CFloatParameter(nodemap, "AutoGainLowerLimit").SetValue(minLowerLimit);
CFloatParameter(nodemap, "AutoGainUpperLimit").SetValue(maxUpperLimit);
// Specify the target value
CFloatParameter(nodemap, "AutoTargetBrightness").SetValue(0.6);
// Select auto function ROI 1
CEnumParameter(nodemap, "AutoFunctionROISelector").SetValue("ROI1");
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
CBooleanParameter(nodemap, "AutoFunctionROIUseBrightness").SetValue(true);
// Enable Gain Auto by setting the operating mode to Continuous
CEnumParameter(nodemap, "GainAuto").SetValue("Continuous");
// Set the the Gain Auto auto function to its minimum lower limit
// and its maximum upper limit
double minLowerLimit = camera.Parameters[PLCamera.AutoGainLowerLimit].GetMinimum();
double maxUpperLimit = camera.Parameters[PLCamera.AutoGainUpperLimit].GetMaximum();
camera.Parameters[PLCamera.AutoGainLowerLimit].SetValue(minLowerLimit);
camera.Parameters[PLCamera.AutoGainUpperLimit].SetValue(maxUpperLimit);
// Specify the target value
camera.Parameters[PLCamera.AutoTargetBrightness].SetValue(0.6);
// Select auto function ROI 1
camera.Parameters[PLCamera.AutoFunctionROISelector].SetValue(PLCamera.AutoFunctionROISelector.ROI1);
// Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
// for the auto function ROI selected
camera.Parameters[PLCamera.AutoFunctionROIUseBrightness].SetValue(true);
// Enable Gain Auto by setting the operating mode to Continuous
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
/* 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 */
double minLowerLimit = 0;
double maxUpperLimit = 0;
/* Set the the Gain Auto auto function to its minimum lower limit */
/* and its maximum upper limit */
errRes = PylonDeviceGetFloatFeatureMin(hdev, "AutoGainLowerLimit", &minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceGetFloatFeatureMax(hdev, "AutoGainUpperLimit", &maxUpperLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoGainLowerLimit", minLowerLimit);
CHECK(errRes);
errRes = PylonDeviceSetFloatFeature(hdev, "AutoGainUpperLimit", maxUpperLimit);
CHECK(errRes);
/* Specify the target value */
errRes = PylonDeviceSetFloatFeature(hdev, "AutoTargetBrightness", 0.6);
CHECK(errRes);
/* Select auto function ROI 1 */
errRes = PylonDeviceFeatureFromString(hdev, "AutoFunctionROISelector", "ROI1");
CHECK(errRes);
/* Enable the 'Brightness' auto function (Gain Auto + Exposure Auto) */
/* for the auto function ROI selected */
errRes = PylonDeviceSetBooleanFeature(hdev, "AutoFunctionROIUseBrightness", 1);
CHECK(errRes);
/* Enable Gain Auto by setting the operating mode to Continuous */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
# Set the the Gain Auto auto function to its minimum lower limit
# and its maximum upper limit
minLowerLimit = camera.AutoGainLowerLimit.Min
maxUpperLimit = camera.AutoGainUpperLimit.Max
camera.AutoGainLowerLimit.Value = minLowerLimit
camera.AutoGainUpperLimit.Value = maxUpperLimit
# Specify the target value
camera.AutoTargetBrightness.Value = 0.6
# Select auto function ROI 1
camera.AutoFunctionROISelector.Value = "ROI1"
# Enable the 'Brightness' auto function (Gain Auto + Exposure Auto)
# for the auto function ROI selected
camera.AutoFunctionROIUseBrightness.Value = True
# Enable Gain Auto by setting the operating mode to Continuous
camera.GainAuto.Value = "Continuous"
또한 pylon Viewer를 사용하여 파라미터를 손쉽게 설정할 수 있습니다.