Please enable JavaScript to view this site.

IDS peak 2.10.0 / uEye+ firmware 3.34

IDS Peak comfortSDK, genericSDK, IPL, and AFL developer manuals are external documents. Please contact us if you need them.

Querying and setting BrightnessAutoTarget

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
uint32_t target = 0;
 
peak_access_status accessStatus = peak_AutoBrightness_GetAccessStatus(hCam);
if (PEAK_IS_READABLE(accessStatus))
{
  // Auto brightness is readable
 
  // Read the target
  status = peak_AutoBrightness_Target_Get(hCam, &target);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}
if (PEAK_IS_WRITEABLE(accessStatus))
{
  // Auto brightness is writeable
  uint32_t targetMin = 0;
  uint32_t targetMax = 0;
  uint32_t targetInc = 0;
 
  // Query the minimum, maximum and increment of the target
  status = peak_AutoBrightness_Target_GetRange(hCam, &targetMin, &targetMax, &targetInc);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
 
  // Set the target to 150
  status = peak_AutoBrightness_Target_Set(hCam, 150);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

// Get the current BrightnessAutoTarget
auto target = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTarget")->Value();
 
// Query the minimum, maximum and increment of BrightnessAutoTarget
auto targetMin = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTarget")->Minimum();
auto targetMax = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTarget")->Maximum();
auto targetInc = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTarget")->Increment();
 
// Set BrightnessAutoTarget to 150
m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTarget")->SetValue(150);

Querying and setting BrightnessAutoPercentile

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
double percentile = 0.0;
 
peak_access_status accessStatus = peak_AutoBrightness_GetAccessStatus(hCam);
if (PEAK_IS_READABLE(accessStatus))
{
  // Auto brightness is readable
 
  // Get the current target percentile
  status = peak_AutoBrightness_TargetPercentile_Get(hCam, &percentile);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}
if (PEAK_IS_WRITEABLE(accessStatus))
{
  // Auto brightness is writeable
  double percentileMin = 0.0;
  double percentileMax = 0.0;
  double percentileInc = 0.0;
 
  // Query the minimum, maximum and increment of the target percentile
  status = peak_AutoBrightness_TargetPercentile_GetRange(hCam, &percentileMin, &percentileMax, &percentileInc);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
 
  // Set the target percentile to 15
  status = peak_AutoBrightness_TargetPercentile_Set(hCam, 15.0);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

// Get the current BrightnessAutoPercentile
auto percentile = m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("BrightnessAutoPercentile")->Value();
 
// Query the minimum, maximum and increment of BrightnessAutoPercentile
auto percentileMin = m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("BrightnessAutoPercentile")->Minimum();
auto percentileMax = m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("BrightnessAutoPercentile")->Maximum();
auto percentileInc = m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("BrightnessAutoPercentile")->Increment();
 
// Set BrightnessAutoPercentile to 15.0
m_nodemapRemoteDevice->FindNode<peak::core::nodes::FloatNode>("BrightnessAutoPercentile")->SetValue(15.0);

Querying and setting BrightnessAutoTargetTolerance

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
uint32_t targetTolerance = 0;
 
peak_access_status accessStatus = peak(hCam);
if (PEAK_IS_READABLE(accessStatus))
{
  // Auto brightness is readable
 
  // Read the target tolerance
  status = peak_AutoBrightness_TargetTolerance_Get(hCam, &targetTolerance);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}
if (PEAK_IS_WRITEABLE(accessStatus))
{
  // Auto brightness is writeable
  uint32_t targetToleranceMin = 0;
  uint32_t targetToleranceMax = 0;
  uint32_t targetToleranceInc = 0;
 
  // Query the minimum, maximum and increment of the target tolerance
  status = peak_AutoBrightness_TargetTolerance_GetRange(hCam, &targetToleranceMin, &targetToleranceMax, &targetToleranceInc);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
 
  // Set the target tolerance to 3
  status = peak_AutoBrightness_TargetTolerance_Set(hCam, 3);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

// Get the current BrightnessAutoTargetTolerance
auto targetTolerance = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTargetTolerance")->Value();
 
// Query the minimum, maximum and increment of BrightnessAutoTargetTolerance
auto targetToleranceMin = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTargetTolerance")->Minimum();
auto targetToleranceMax = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTargetTolerance")->Maximum();
auto targetToleranceInc = m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTargetTolerance")->Increment();
 
// Set BrightnessAutoTargetTolerance to 3
m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("BrightnessAutoTargetTolerance")->SetValue(3);

Brightness parameters: Querying and setting sub-region

You can set an image area (sub-region) for the brightness control to be applied. Normally, the total image ROI is used for the brightness ROI. To set a different sub-region, first disable SubRegionFollowSource of the brightness ROI. Then you can set the new values for the position and size.

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
 
peak_access_status accessStatus = peak_AutoBrightness_GetAccessStatus(hCam);
if (PEAK_IS_WRITEABLE(accessStatus))
{
  status = peak_AutoBrightness_ROI_Mode_Set(hCam, PEAK_AUTO_FEATURE_ROI_MODE_MANUAL);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
 
  peak_roi roi = { { 16, 16 }, { 256, 256 } };
  status = peak_AutoBrightness_ROI_Set(hCam, roi);
  if (PEAK_ERROR(status)) { /* Error handling ... */ }
}

genericC++

m_nodemapRemoteDevice->FindNode<peak::core::nodes::EnumerationNode>("SubRegionSelector")->SetCurrentEntry("AutoFeatureBrightnessAuto");
 
m_nodemapRemoteDevice->FindNode<peak::core::nodes::BooleanNode>("SubRegionFollowSource")->SetValue(false);
 
m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("SubRegionOffsetX")->SetValue(10);
m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("SubRegionOffsetY")->SetValue(10);
m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("SubRegionOffsetWidth")->SetValue(100);
m_nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("SubRegionOffsetHeight")->SetValue(100);

hint_info

It is recommended to check the valid value range before setting the ROI. It is done accordingly to the image section, see Setting a ROI (region of interest).

© 2024 IDS Imaging Development Systems GmbH