Skip to content

Commit 0b6e484

Browse files
author
SzabolcsGergely
committed
Add 3A skipping option to reduce CPU usage
1 parent 244ffba commit 0b6e484

File tree

8 files changed

+35
-2
lines changed

8 files changed

+35
-2
lines changed

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 "1b9a2401edd53bf26e8af00b71dc0941c1217b31")
5+
set(DEPTHAI_DEVICE_SIDE_COMMIT "8f6a30a17a5c7076c6b05260f9c07ab80f54ab12")
66

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

include/depthai/pipeline/node/Camera.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ class Camera : public NodeCRTP<Node, Camera, CameraProperties> {
198198
*/
199199
void setFps(float fps);
200200

201+
/**
202+
* Image tuning, 3A rate.
203+
* Default (0) matches the camera FPS, meaning that statistics for auto exposure are collected on each frame.
204+
* Reducing the rate of 3A reduces the CPU usage on MSS, but also reduces the convergence rate of 3A.
205+
*/
206+
void set3AFpsDenominator(int denominator);
207+
201208
/**
202209
* Get rate at which camera should produce frames
203210
* @returns Rate in frames per second

include/depthai/pipeline/node/ColorCamera.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ class ColorCamera : public NodeCRTP<Node, ColorCamera, ColorCameraProperties> {
222222
*/
223223
void setFps(float fps);
224224

225+
/**
226+
* Image tuning, 3A rate.
227+
* Default (0) matches the camera FPS, meaning that statistics for auto exposure are collected on each frame.
228+
* Reducing the rate of 3A reduces the CPU usage on MSS, but also reduces the convergence rate of 3A.
229+
*/
230+
void set3AFpsDenominator(int denominator);
231+
225232
// Set events on which frames will be received
226233
void setFrameEventFilter(const std::vector<dai::FrameEvent>& events);
227234

include/depthai/pipeline/node/MonoCamera.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ class MonoCamera : public NodeCRTP<Node, MonoCamera, MonoCameraProperties> {
117117
*/
118118
void setFps(float fps);
119119

120+
/**
121+
* Image tuning, 3A rate.
122+
* Default (0) matches the camera FPS, meaning that statistics for auto exposure are collected on each frame.
123+
* Reducing the rate of 3A reduces the CPU usage on MSS, but also reduces the convergence rate of 3A.
124+
*/
125+
void set3AFpsDenominator(int denominator);
126+
120127
/**
121128
* Get rate at which camera should produce frames
122129
* @returns Rate in frames per second

src/pipeline/node/Camera.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ void Camera::setFps(float fps) {
130130
properties.fps = fps;
131131
}
132132

133+
void Camera::set3AFpsDenominator(int denominator) {
134+
properties.imageTuningFpsDenominator = denominator;
135+
}
136+
133137
float Camera::getFps() const {
134138
// if AUTO
135139
if(properties.fps == CameraProperties::AUTO || properties.fps == 0) {

src/pipeline/node/ColorCamera.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ void ColorCamera::setFps(float fps) {
177177
properties.fps = fps;
178178
}
179179

180+
void ColorCamera::set3AFpsDenominator(int denominator) {
181+
properties.imageTuningFpsDenominator = denominator;
182+
}
183+
180184
void ColorCamera::setFrameEventFilter(const std::vector<dai::FrameEvent>& events) {
181185
properties.eventFilter = events;
182186
}

src/pipeline/node/MonoCamera.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ void MonoCamera::setFps(float fps) {
9999
properties.fps = fps;
100100
}
101101

102+
void MonoCamera::set3AFpsDenominator(int denominator) {
103+
properties.imageTuningFpsDenominator = denominator;
104+
}
105+
102106
float MonoCamera::getFps() const {
103107
// if AUTO
104108
if(properties.fps == -1 || properties.fps == 0) {

0 commit comments

Comments
 (0)