Skip to content

Commit 03b915f

Browse files
MaticToninmtramsak-luxonis
authored andcommitted
Merge pull request #1833 from luxonis/bugfix/remove_unused_variable
Remove unused logger in SpatialUtils
2 parents 9f5e0eb + 6974f35 commit 03b915f

7 files changed

Lines changed: 43 additions & 8 deletions

File tree

bindings/python/src/pipeline/datatype/CameraControlBindings.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ void bind_cameracontrol(pybind11::module& m, void* pCallstack) {
8080
.value("AF_REGION", CameraControl::Command::AF_REGION)
8181
.value("LUMA_DENOISE", CameraControl::Command::LUMA_DENOISE)
8282
.value("CHROMA_DENOISE", CameraControl::Command::CHROMA_DENOISE)
83-
.value("WB_COLOR_TEMP", CameraControl::Command::WB_COLOR_TEMP);
83+
.value("WB_COLOR_TEMP", CameraControl::Command::WB_COLOR_TEMP)
84+
.value("AE_MAX_ISO", CameraControl::Command::AE_MAX_ISO);
8485

8586
camCtrlAttr.push_back("AutoFocusMode");
8687
cameraControlAutoFocusMode.value("OFF", CameraControl::AutoFocusMode::OFF)
@@ -237,6 +238,10 @@ void bind_cameracontrol(pybind11::module& m, void* pCallstack) {
237238
py::overload_cast<std::chrono::microseconds>(&CameraControl::setAutoExposureLimit),
238239
py::arg("maxExposureTime"),
239240
DOC(dai, CameraControl, setAutoExposureLimit, 2))
241+
.def("setAutoExposureMaxISO",
242+
&CameraControl::setAutoExposureMaxISO,
243+
py::arg("aeMaxISO"),
244+
DOC(dai, CameraControl, setAutoExposureMaxISO))
240245
.def("setAntiBandingMode", &CameraControl::setAntiBandingMode, py::arg("mode"), DOC(dai, CameraControl, setAntiBandingMode))
241246
.def("setManualExposure",
242247
py::overload_cast<uint32_t, uint32_t>(&CameraControl::setManualExposure),

cmake/Depthai/DepthaiDeviceRVC4Config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
set(DEPTHAI_DEVICE_RVC4_MATURITY "snapshot")
44

55
# "version if applicable"
6-
set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+656f19d8caeedccb34cd4ba2fe4b2711affab61b")
6+
set(DEPTHAI_DEVICE_RVC4_VERSION "0.0.1+d966b3faf3a09dccabc58eb60a783a664f0459ad")

cmake/Depthai/DepthaiDeviceSideConfig.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")
33

44
# "full commit hash of device side binary"
5-
set(DEPTHAI_DEVICE_SIDE_COMMIT "8d6a04d380ce182e0cb3a4694309426370295a9f")
5+
set(DEPTHAI_DEVICE_SIDE_COMMIT "fe224dcd1222ce43d3afadb6524b2174e975559a")
66

77
# "version if applicable"
88
set(DEPTHAI_DEVICE_SIDE_VERSION "")

include/depthai/pipeline/datatype/CameraControl.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class CameraControl : public Buffer {
122122
STROBE_TIMINGS = 54,
123123
MOVE_LENS_RAW = 55, /* lens position: 0.0 - 1.0 */
124124
HDR = 56,
125+
AE_MAX_ISO = 57,
125126
};
126127

127128
enum class AutoFocusMode : uint8_t {
@@ -561,6 +562,14 @@ class CameraControl : public Buffer {
561562
*/
562563
CameraControl& setAutoExposureLimit(std::chrono::microseconds maxExposureTime);
563564

565+
/**
566+
* Set a command to specify the maximum ISO sensitivity limit for auto-exposure.
567+
* This limits the AE algorithm from increasing sensitivity beyond a certain point
568+
* and can help to reduce noise in low-light conditions.
569+
* @param aeMaxISO Maximum ISO
570+
*/
571+
CameraControl& setAutoExposureMaxISO(int32_t aeMaxISO);
572+
564573
/**
565574
* Set a command to specify anti-banding mode. Anti-banding / anti-flicker
566575
* works in auto-exposure mode, by controlling the exposure time to be applied
@@ -765,6 +774,7 @@ class CameraControl : public Buffer {
765774
StrobeConfig strobeConfig;
766775
StrobeTimings strobeTimings;
767776
uint32_t aeMaxExposureTimeUs;
777+
int32_t aeMaxISO;
768778
bool aeLockMode{false};
769779
bool awbLockMode{false};
770780
int8_t expCompensation; // -9 .. 9
@@ -824,6 +834,7 @@ class CameraControl : public Buffer {
824834
strobeConfig,
825835
strobeTimings,
826836
aeMaxExposureTimeUs,
837+
aeMaxISO,
827838
expCompensation,
828839
brightness,
829840
contrast,

src/pipeline/datatype/CameraControl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ CameraControl& CameraControl::setAutoExposureLimit(uint32_t maxExposureTimeUs) {
122122
CameraControl& CameraControl::setAutoExposureLimit(std::chrono::microseconds maxExposureTime) {
123123
return setAutoExposureLimit(maxExposureTime.count());
124124
}
125+
CameraControl& CameraControl::setAutoExposureMaxISO(int32_t aeMaxISO) {
126+
setCommand(CameraControl::Command::AE_MAX_ISO);
127+
this->aeMaxISO = aeMaxISO;
128+
return *this;
129+
}
125130
CameraControl& CameraControl::setAntiBandingMode(AntiBandingMode mode) {
126131
setCommand(Command::ANTIBANDING_MODE);
127132
antiBandingMode = mode;

src/pipeline/utilities/SpatialLocationCalculator/SpatialUtils.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ dai::SpatialImgDetection computeSpatialDetection(const dai::ImgFrame& depthFrame
302302
const int instanceIndex,
303303
const dai::ImgTransformation& detectionsTransformation,
304304
const int segMaskWidth,
305-
const int segMaskHeight,
306-
const std::shared_ptr<spdlog::async_logger>& logger) {
305+
const int segMaskHeight) {
307306
const uint32_t lowerThreshold = config.globalLowerThreshold;
308307
const uint32_t upperThreshold = config.globalUpperThreshold;
309308
const SpatialLocationCalculatorAlgorithm calculationAlgorithm = config.globalCalculationAlgorithm;
@@ -454,8 +453,7 @@ void computeSpatialDetections(const dai::ImgFrame& depthFrame,
454453
i,
455454
*detectionsTransformation,
456455
static_cast<int>(segmentationMaskWidth),
457-
static_cast<int>(segmentationMaskHeight),
458-
logger);
456+
static_cast<int>(segmentationMaskHeight));
459457
spatialDetections.detections[i] = spatialImgDetection;
460458
}
461459
}

utilities/cam_test.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
exposure time: I O 1..33000 [us]
88
sensitivity iso: K L 100..1600
99
focus: , . 0..255 [far..near]
10+
for auto exposure:
11+
Control: key[dec/inc] min..max
12+
max exposure time: g h 1..33000 [us]
13+
max ISO: b n 100..1600
1014
To go back to auto controls:
1115
'E' - autoexposure
1216
'F' - autofocus (continuous)
@@ -567,6 +571,7 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
567571
floodIntensity = 0
568572

569573
expTimeLimit = 700
574+
expMaxISO = 500
570575

571576
awb_mode = Cycle(dai.CameraControl.AutoWhiteBalanceMode)
572577
anti_banding_mode = Cycle(dai.CameraControl.AntiBandingMode)
@@ -753,9 +758,20 @@ def controlQueueSend(ctrl):
753758
expTimeLimit -= 50
754759
else:
755760
expTimeLimit += 50
756-
print("Exposure time limit: ", expTimeLimit)
761+
print("Auto exposure time limit: ", expTimeLimit)
757762
ctrl = dai.CameraControl()
758763
ctrl.setAutoExposureLimit(expTimeLimit)
764+
ctrl.setAutoExposureEnable()
765+
controlQueueSend(ctrl)
766+
elif key in [ord('b'), ord('n')]:
767+
if key == ord('b'):
768+
expMaxISO -= 50
769+
else:
770+
expMaxISO += 50
771+
print("Auto exposure ISO limit: ", expMaxISO)
772+
ctrl = dai.CameraControl()
773+
ctrl.setAutoExposureMaxISO(expMaxISO)
774+
ctrl.setAutoExposureEnable()
759775
controlQueueSend(ctrl)
760776
elif key == ord('1'):
761777
awb_lock = not awb_lock

0 commit comments

Comments
 (0)