Skip to content

Commit 1e1a6c6

Browse files
committed
Merge branch 'release_v2.19.1.0' into main
2 parents 739f367 + a313f6f commit 1e1a6c6

File tree

5 files changed

+39
-4
lines changed

5 files changed

+39
-4
lines changed

examples/ColorCamera/rgb_preview.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
# Connect to device and start pipeline
2424
with dai.Device(pipeline) as device:
2525

26-
print('Connected cameras: ', device.getConnectedCameras())
26+
print('Connected cameras:', device.getConnectedCameras())
2727
# Print out usb speed
28-
print('Usb speed: ', device.getUsbSpeed().name)
28+
print('Usb speed:', device.getUsbSpeed().name)
2929
# Bootloader version
3030
if device.getBootloaderVersion() is not None:
31-
print('Bootloader version: ', device.getBootloaderVersion())
31+
print('Bootloader version:', device.getBootloaderVersion())
32+
# Device name
33+
print('Device name:', device.getDeviceName())
3234

3335
# Output queue will be used to get the rgb frames from the output defined above
3436
qRgb = device.getOutputQueue(name="rgb", maxSize=4, blocking=False)

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ def build_extension(self, ext):
222222
"Programming Language :: Python :: 3.8",
223223
"Programming Language :: Python :: 3.9",
224224
"Programming Language :: Python :: 3.10",
225+
"Programming Language :: Python :: 3.11",
225226
"Programming Language :: C++",
226227
"Programming Language :: Python :: Implementation :: CPython",
227228
"Topic :: Scientific/Engineering",

src/DeviceBindings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ void DeviceBindings::bind(pybind11::module& m, void* pCallstack){
536536
.def("flashFactoryEepromClear", [](DeviceBase& d) { py::gil_scoped_release release; d.flashFactoryEepromClear(); }, DOC(dai, DeviceBase, flashFactoryEepromClear))
537537
.def("setTimesync", [](DeviceBase& d, std::chrono::milliseconds p, int s, bool r) { py::gil_scoped_release release; return d.setTimesync(p,s,r); }, DOC(dai, DeviceBase, setTimesync))
538538
.def("setTimesync", [](DeviceBase& d, bool e) { py::gil_scoped_release release; return d.setTimesync(e); }, py::arg("enable"), DOC(dai, DeviceBase, setTimesync, 2))
539+
.def("getDeviceName", [](DeviceBase& d) { py::gil_scoped_release release; return d.getDeviceName(); }, DOC(dai, DeviceBase, getDeviceName))
539540
;
540541

541542

utilities/cam_test.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
'0' - Select control: sharpness
2525
'[' - Select control: luma denoise
2626
']' - Select control: chroma denoise
27+
'a' 'd' - Increase/decrease dot projector intensity
28+
'w' 's' - Increase/decrease flood LED intensity
2729
2830
For the 'Select control: ...' options, use these keys to modify the value:
2931
'-' or '_' to decrease
@@ -191,6 +193,8 @@ def get(self):
191193

192194
print('USB speed:', device.getUsbSpeed().name)
193195

196+
print('IR drivers:', device.getIrDrivers())
197+
194198
q = {}
195199
fps_host = {} # FPS computed based on the time we receive frames in app
196200
fps_capt = {} # FPS computed based on capture timestamps from device
@@ -209,6 +213,10 @@ def get(self):
209213
EXP_STEP = 500 # us
210214
ISO_STEP = 50
211215
LENS_STEP = 3
216+
DOT_STEP = 100
217+
FLOOD_STEP = 100
218+
DOT_MAX = 1200
219+
FLOOD_MAX = 1500
212220

213221
# Defaults and limits for manual focus/exposure controls
214222
lensPos = 150
@@ -223,6 +231,9 @@ def get(self):
223231
sensMin = 100
224232
sensMax = 1600
225233

234+
dotIntensity = 0
235+
floodIntensity = 0
236+
226237
awb_mode = cycle([item for name, item in vars(dai.CameraControl.AutoWhiteBalanceMode).items() if name.isupper()])
227238
anti_banding_mode = cycle([item for name, item in vars(dai.CameraControl.AntiBandingMode).items() if name.isupper()])
228239
effect_mode = cycle([item for name, item in vars(dai.CameraControl.EffectMode).items() if name.isupper()])
@@ -321,6 +332,26 @@ def get(self):
321332
ctrl = dai.CameraControl()
322333
ctrl.setAutoExposureLock(ae_lock)
323334
controlQueue.send(ctrl)
335+
elif key == ord('a'):
336+
dotIntensity = dotIntensity - DOT_STEP
337+
if dotIntensity < 0:
338+
dotIntensity = 0
339+
device.setIrLaserDotProjectorBrightness(dotIntensity)
340+
elif key == ord('d'):
341+
dotIntensity = dotIntensity + DOT_STEP
342+
if dotIntensity > DOT_MAX:
343+
dotIntensity = DOT_MAX
344+
device.setIrLaserDotProjectorBrightness(dotIntensity)
345+
elif key == ord('w'):
346+
floodIntensity = floodIntensity + FLOOD_STEP
347+
if floodIntensity > FLOOD_MAX:
348+
floodIntensity = FLOOD_MAX
349+
device.setIrFloodLightBrightness(floodIntensity)
350+
elif key == ord('s'):
351+
floodIntensity = floodIntensity - FLOOD_STEP
352+
if floodIntensity < 0:
353+
floodIntensity = 0
354+
device.setIrFloodLightBrightness(floodIntensity)
324355
elif key >= 0 and chr(key) in '34567890[]':
325356
if key == ord('3'): control = 'awb_mode'
326357
elif key == ord('4'): control = 'ae_comp'

0 commit comments

Comments
 (0)