Skip to content

Commit

Permalink
oak - manual exposure time for color (#986)
Browse files Browse the repository at this point in the history
* config/test-oak-camera.json: add manual exposure

* oak_camera.py: add manual exposure
  • Loading branch information
tajgr authored Apr 3, 2024
1 parent 8cee8fa commit ddeabd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/test-oak-camera.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"mono_resolution": "THE_400_P",
"color_resolution": "THE_1080_P",
"color_manual_focus": 130,
"color_manual_exposure": null,

"stereo_median_filter": "KERNEL_3x3",
"stereo_mode": "HIGH_ACCURACY",
Expand Down
5 changes: 4 additions & 1 deletion osgar/drivers/oak_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def __init__(self, config, bus):
self.is_left_right_check = config.get("stereo_left_right_check", False)
assert not(self.is_extended_disparity and self.is_subpixel) # Do not use extended_disparity and subpixel together.

self.color_manual_focus = config.get("color_manual_focus")
self.color_manual_focus = config.get("color_manual_focus") # 0..255 [far..near]
self.color_manual_exposure = config.get("color_manual_exposure") # 1..33000 [us]

mono_resolution_value = config.get("mono_resolution", "THE_400_P")
assert mono_resolution_value in ["THE_400_P", "THE_480_P", "THE_720_P", "THE_800_P"], mono_resolution_value
Expand Down Expand Up @@ -93,6 +94,8 @@ def run_input(self):
# https://docs.luxonis.com/projects/api/en/latest/samples/StereoDepth/rgb_depth_aligned/
if self.color_manual_focus is not None:
color.initialControl.setManualFocus(self.color_manual_focus)
if self.color_manual_exposure is not None:
color.initialControl.setManualExposure(self.color_manual_exposure, 100) # exposure time and ISO

color_encoder.setDefaultProfilePreset(self.fps, dai.VideoEncoderProperties.Profile.MJPEG)

Expand Down

0 comments on commit ddeabd2

Please sign in to comment.