Gain Auto#
자동 기능을 위한 픽셀 데이터는 하나 또는 여러 개의 Auto Function ROI에서 가져올 수 있습니다.
Gain Auto와 Exposure Auto를 동시에 사용하려면 Auto Function Profile 기능을 사용하여 두 기능의 효과가 균형을 이루는 방식을 지정하십시오.
gain을 수동으로 조절하려면 Gain 기능을 사용하십시오.
기능 사용#
Gain Auto 활성화 또는 비활성화#
Gain Auto 자동 기능을 활성화 또는 비활성화하려면:
- Gain Auto 자동 기능에 최소 한 개의 자동 기능 ROI를 할당하십시오.
자동 기능 ROI가 이미지 ROI와 부분적으로든 완전히든 겹치도록 하십시오. - 파라미터를 원하는
GainAuto파라미터를 다음 Operating Mode 중 하나로 설정하십시오.Once: 카메라는 지정된 값이 될 때까지 게인을 조정합니다. 목표 밝기 값 에 도달했습니다. 이 조건이 충족되거나 최대 30회의 계산 주기가 경과하면, 카메라는 자동 기능을 [Off`로 설정하고 마지막 계산에서 도출된 게인을 이후의 모든 이미지에 적용합니다.Continuous: 카메라가 이미지를 촬영하는 동안 게인을 지속적으로 조정합니다.Off: ‘ Gain Auto ’ 자동 기능을 비활성화합니다. 게인은 마지막으로 자동 또는 수동으로 조정된 값을 유지합니다.
정보
카메라가 연속으로 사진을 촬영할 때, 자동 기능은 약간의 지연 후 작동합니다. 처음 몇 장의 사진에는 자동 기능이 적용되지 않을 수 있습니다.
상한 및 하한값 지정#
자동 기능은 다음을 조정합니다. Gain 사용자가 지정한 범위 내의 매개변수 값.
한도를 변경하려면 다음을 설정하십시오. AutoGainLowerLimit 그리고 다음을 설정합니다. AutoGainUpperLimit 매개변수를 원하는 값으로 설정하십시오.
예: 다음과 같이 설정했다고 가정해 봅시다. AutoGainLowerLimit 매개변수를 2로 설정하고, AutoGainUpperLimit 매개변수를 6으로 설정합니다. 자동 조정 과정 중에는 이득이 2보다 낮아지거나 6보다 높아지는 일이 없습니다.
목표 밝기 값 지정#
자동 기능은 목표 밝기 값, 즉 평균 회색값에 도달할 때까지 게인을 조정합니다.
목표값을 지정하려면 다음을 사용하십시오. AutoTargetBrightness 파라미터에 HTML 로그 파일(*.html)의 경로와 이름을 지정할 수 있습니다.
정보
- 목표값 계산에는 다른 이미지 최적화(예: Gamma. 설정된 이미지 최적화 방식에 따라, 카메라에서 출력되는 이미지의 평균 회색값은 목표값이 나타내는 값보다 상당히 낮거나 높을 수 있습니다.
- 이 카메라는 또한
AutoTargetBrightness~를 제어하는 매개변수 Exposure Auto auto 함수. Gain Auto 를 사용하려면 Exposure Auto 동시에 다음을 사용합니다. Auto Function Profile 기능을 사용하여 두 가지 효과의 균형이 맞춰지는 정도를 지정할 수 있습니다. - 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 Cameras#
// 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를 사용하여 파라미터를 손쉽게 설정할 수도 있습니다.