Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.13.3 #288

Merged
merged 10 commits into from
Dec 1, 2021
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.13.2" LANGUAGES CXX C)
project(depthai VERSION "2.13.3" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down
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 "29036665ba3c8416048f602f0bfc82c17d26fc2e")
set(DEPTHAI_DEVICE_SIDE_COMMIT "48fca4a443d841221c94c70d5c05e7e946168636")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
4 changes: 2 additions & 2 deletions cmake/Hunter/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ hunter_config(
hunter_config(
XLink
VERSION "luxonis-2021.4-master"
URL "https://github.com/luxonis/XLink/archive/d2de4895b8f956b3f3afea220a95a30dd4a3ae79.tar.gz"
SHA1 "2f58b22a9c2441f9adf8ebd871f2d08162ec552b"
URL "https://github.com/luxonis/XLink/archive/09fcfc93ca7060b07fe21db7371fc83e04a257f3.tar.gz"
SHA1 "7c8a947e80aaab7ceeb615001349f44e4162af4a"
)

hunter_config(
Expand Down
24 changes: 22 additions & 2 deletions examples/ColorCamera/rgb_camera_control.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/**
* This example shows usage of Camera Control message as well as ColorCamera configInput to change crop x and y
* Uses 'WASD' controls to move the crop window, 'C' to capture a still image, 'T' to trigger autofocus, 'IOKL,.'
* for manual exposure/focus:
* Uses 'WASD' controls to move the crop window, 'C' to capture a still image, 'T' to trigger autofocus, 'IOKL,.[]'
* for manual exposure/focus/white-balance:
* Control: key[dec/inc] min..max
* exposure time: I O 1..33000 [us]
* sensitivity iso: K L 100..1600
* focus: , . 0..255 [far..near]
* white balance: [ ] 1000..12000 (light color temperature K)
* To go back to auto controls:
* 'E' - autoexposure
* 'F' - autofocus (continuous)
* 'B' - auto white-balance
*/
#include <iostream>

Expand All @@ -24,6 +26,7 @@ static constexpr int STEP_SIZE = 8;
static constexpr int EXP_STEP = 500; // us
static constexpr int ISO_STEP = 50;
static constexpr int LENS_STEP = 3;
static constexpr int WB_STEP = 200;

static int clamp(int num, int v0, int v1) {
return std::max(v0, std::min(num, v1));
Expand Down Expand Up @@ -97,6 +100,10 @@ int main() {
int sensMin = 100;
int sensMax = 1600;

int wbManual = 4000;
int wbMin = 1000;
int wbMax = 12000;

while(true) {
auto previewFrames = previewQueue->tryGetAll<dai::ImgFrame>();
for(const auto& previewFrame : previewFrames) {
Expand Down Expand Up @@ -153,6 +160,11 @@ int main() {
dai::CameraControl ctrl;
ctrl.setAutoExposureEnable();
controlQueue->send(ctrl);
} else if(key == 'b') {
printf("Auto white-balance enable\n");
dai::CameraControl ctrl;
ctrl.setAutoWhiteBalanceMode(dai::CameraControl::AutoWhiteBalanceMode::AUTO);
controlQueue->send(ctrl);
} else if(key == ',' || key == '.') {
if(key == ',') lensPos -= LENS_STEP;
if(key == '.') lensPos += LENS_STEP;
Expand All @@ -172,6 +184,14 @@ int main() {
dai::CameraControl ctrl;
ctrl.setManualExposure(expTime, sensIso);
controlQueue->send(ctrl);
} else if(key == '[' || key == ']') {
if(key == '[') wbManual -= WB_STEP;
if(key == ']') wbManual += WB_STEP;
wbManual = clamp(wbManual, wbMin, wbMax);
printf("Setting manual white balance, temperature: %d K\n", wbManual);
dai::CameraControl ctrl;
ctrl.setManualWhiteBalance(wbManual);
controlQueue->send(ctrl);
} else if(key == 'w' || key == 'a' || key == 's' || key == 'd') {
if(key == 'a') {
cropX -= (maxCropX / camRgb->getResolutionWidth()) * STEP_SIZE;
Expand Down
6 changes: 6 additions & 0 deletions include/depthai/pipeline/datatype/CameraControl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ class CameraControl : public Buffer {
*/
void setAutoWhiteBalanceLock(bool lock);

/**
* Set a command to manually specify white-balance color correction
* @param colorTemperatureK Light source color temperature in kelvins, range 1000..12000
*/
void setManualWhiteBalance(int colorTemperatureK);

// Other image controls
/**
* Set a command to adjust image brightness
Expand Down
2 changes: 1 addition & 1 deletion shared/depthai-shared
5 changes: 4 additions & 1 deletion src/pipeline/datatype/CameraControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void CameraControl::setAutoFocusRegion(uint16_t startX, uint16_t startY, uint16_
void CameraControl::setManualFocus(uint8_t lensPosition) {
cfg.setCommand(RawCameraControl::Command::MOVE_LENS);
cfg.lensPosition = lensPosition;
setAutoFocusMode(AutoFocusMode::OFF); // TODO added for initialConfig case
}

// Exposure
Expand Down Expand Up @@ -85,6 +84,10 @@ void CameraControl::setAutoWhiteBalanceLock(bool lock) {
cfg.setCommand(RawCameraControl::Command::AWB_LOCK);
cfg.awbLockMode = lock;
}
void CameraControl::setManualWhiteBalance(int colorTemperatureK) {
cfg.setCommand(RawCameraControl::Command::WB_COLOR_TEMP);
cfg.wbColorTemp = colorTemperatureK;
}

// Other image controls
void CameraControl::setBrightness(int value) {
Expand Down