Skip to content

Commit

Permalink
Merge pull request #926 from luxonis/ae_exp_limit
Browse files Browse the repository at this point in the history
AE exposure time limit, OV9282/OV9782 image quality and FPS improvements
  • Loading branch information
alex-luxonis authored Nov 24, 2023
2 parents 6a10051 + 2928a70 commit 7b6f022
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "9f8bc9fe677b7a1fce27f78448fe348ce6e122e0")
set(DEPTHAI_DEVICE_SIDE_COMMIT "cae51725e78d8128ee7324c13f74648bcc59addc")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
18 changes: 17 additions & 1 deletion include/depthai/pipeline/datatype/CameraControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@ class CameraControl : public Buffer {
*/
CameraControl& setAutoExposureCompensation(int compensation);

/**
* Set a command to specify the maximum exposure time limit for auto-exposure. By default
* the AE algorithm prioritizes increasing exposure over ISO, up to around frame-time
* (subject to further limits imposed by anti-banding)
* @param maxExposureTimeUs Maximum exposure time in microseconds
*/
CameraControl& setAutoExposureLimit(uint32_t maxExposureTimeUs);

/**
* Set a command to specify the maximum exposure time limit for auto-exposure. By default
* the AE algorithm prioritizes increasing exposure over ISO, up to around frame-time
* (subject to further limits imposed by anti-banding)
* @param maxExposureTime Maximum exposure time
*/
CameraControl& setAutoExposureLimit(std::chrono::microseconds maxExposureTime);

/**
* Set a command to specify anti-banding mode. Anti-banding / anti-flicker
* works in auto-exposure mode, by controlling the exposure time to be applied
Expand All @@ -186,7 +202,7 @@ class CameraControl : public Buffer {
* @param exposureTime Exposure time
* @param sensitivityIso Sensitivity as ISO value, usual range 100..1600
*/
void setManualExposure(std::chrono::microseconds exposureTime, uint32_t sensitivityIso);
CameraControl& setManualExposure(std::chrono::microseconds exposureTime, uint32_t sensitivityIso);

// White Balance
/**
Expand Down
2 changes: 1 addition & 1 deletion shared/depthai-shared
12 changes: 10 additions & 2 deletions src/pipeline/datatype/CameraControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ CameraControl& CameraControl::setAutoExposureCompensation(int compensation) {
cfg.expCompensation = compensation;
return *this;
}
CameraControl& CameraControl::setAutoExposureLimit(uint32_t maxExposureTimeUs) {
cfg.setCommand(RawCameraControl::Command::AE_TARGET_FPS_RANGE);
cfg.aeMaxExposureTimeUs = maxExposureTimeUs;
return *this;
}
CameraControl& CameraControl::setAutoExposureLimit(std::chrono::microseconds maxExposureTime) {
return setAutoExposureLimit(maxExposureTime.count());
}
CameraControl& CameraControl::setAntiBandingMode(AntiBandingMode mode) {
cfg.setCommand(RawCameraControl::Command::ANTIBANDING_MODE);
cfg.antiBandingMode = mode;
Expand All @@ -128,8 +136,8 @@ CameraControl& CameraControl::setManualExposure(uint32_t exposureTimeUs, uint32_
return *this;
}

void CameraControl::setManualExposure(std::chrono::microseconds exposureTime, uint32_t sensitivityIso) {
setManualExposure(exposureTime.count(), sensitivityIso);
CameraControl& CameraControl::setManualExposure(std::chrono::microseconds exposureTime, uint32_t sensitivityIso) {
return setManualExposure(exposureTime.count(), sensitivityIso);
}

// White Balance
Expand Down

0 comments on commit 7b6f022

Please sign in to comment.