@@ -189,6 +189,7 @@ def get(self):
189
189
xout = {}
190
190
xout_raw = {}
191
191
streams = []
192
+ tofConfig = {}
192
193
for c in cam_list :
193
194
tofEnableRaw = False
194
195
xout [c ] = pipeline .createXLinkOut ()
@@ -204,9 +205,10 @@ def get(self):
204
205
tof [c ].depth .link (xout [c ].input )
205
206
xinTofConfig .out .link (tof [c ].inputConfig )
206
207
tofConfig = tof [c ].initialConfig .get ()
207
- tofConfig .setFreqModUsed (dai .ToFConfig .DepthParams .TypeFMod .F_MOD_MIN )
208
- tofConfig .SetAvgPhaseShuffle (True )
209
- tofConfig .setMinAmplitude (20.0 )
208
+ tofConfig .depthParams .freqModUsed = dai .RawToFConfig .DepthParams .TypeFMod .MIN
209
+ tofConfig .depthParams .avgPhaseShuffle = False
210
+ tofConfig .depthParams .minimumAmplitude = 3.0
211
+ tof [c ].initialConfig .set (tofConfig )
210
212
elif cam_type_color [c ]:
211
213
cam [c ] = pipeline .createColorCamera ()
212
214
cam [c ].setResolution (color_res_opts [args .color_resolution ])
@@ -287,6 +289,7 @@ def exit_cleanly(signum, frame):
287
289
fps_capt [c ] = FPS ()
288
290
289
291
controlQueue = device .getInputQueue ('control' )
292
+ tofCfgQueue = device .getInputQueue ('tofConfig' )
290
293
291
294
# Manual exposure/focus set step
292
295
EXP_STEP = 500 # us
@@ -331,6 +334,7 @@ def exit_cleanly(signum, frame):
331
334
chroma_denoise = 0
332
335
control = 'none'
333
336
show = False
337
+ tof_amp_min = tofConfig .depthParams .minimumAmplitude
334
338
335
339
print ("Cam:" , * [' ' + c .ljust (8 )
336
340
for c in cam_list ], "[host | capture timestamp]" )
@@ -419,6 +423,11 @@ def exit_cleanly(signum, frame):
419
423
elif key == ord ('c' ):
420
424
capture_list = streams .copy ()
421
425
capture_time = time .strftime ('%Y%m%d_%H%M%S' )
426
+ elif key == ord ('g' ):
427
+ f_mod = dai .RawToFConfig .DepthParams .TypeFMod .MAX if tofConfig .depthParams .freqModUsed == dai .RawToFConfig .DepthParams .TypeFMod .MIN else dai .RawToFConfig .DepthParams .TypeFMod .MIN
428
+ print ("ToF toggling f_mod value to:" , f_mod )
429
+ tofConfig .depthParams .freqModUsed = f_mod
430
+ tofCfgQueue .send (tofConfig )
422
431
elif key == ord ('t' ):
423
432
print ("Autofocus trigger (and disable continuous)" )
424
433
ctrl = dai .CameraControl ()
@@ -493,7 +502,7 @@ def exit_cleanly(signum, frame):
493
502
if floodIntensity < 0 :
494
503
floodIntensity = 0
495
504
device .setIrFloodLightBrightness (floodIntensity )
496
- elif key >= 0 and chr (key ) in '34567890[]' :
505
+ elif key >= 0 and chr (key ) in '34567890[]p ' :
497
506
if key == ord ('3' ):
498
507
control = 'awb_mode'
499
508
elif key == ord ('4' ):
@@ -514,6 +523,8 @@ def exit_cleanly(signum, frame):
514
523
control = 'luma_denoise'
515
524
elif key == ord (']' ):
516
525
control = 'chroma_denoise'
526
+ elif key == ord ('p' ):
527
+ control = 'tof_amplitude_min'
517
528
print ("Selected control:" , control )
518
529
elif key in [ord ('-' ), ord ('_' ), ord ('+' ), ord ('=' )]:
519
530
change = 0
@@ -564,4 +575,9 @@ def exit_cleanly(signum, frame):
564
575
chroma_denoise = clamp (chroma_denoise + change , 0 , 4 )
565
576
print ("Chroma denoise:" , chroma_denoise )
566
577
ctrl .setChromaDenoise (chroma_denoise )
578
+ elif control == 'tof_amplitude_min' :
579
+ amp_min = clamp (tofConfig .depthParams .minimumAmplitude + change , 0 , 50 )
580
+ print ("Setting min amplitude(confidence) to:" , amp_min )
581
+ tofConfig .depthParams .minimumAmplitude = amp_min
582
+ tofCfgQueue .send (tofConfig )
567
583
controlQueue .send (ctrl )
0 commit comments