Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed references to tof's depthParams #1009

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions examples/ToF/tof_depth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@

tof = pipeline.create(dai.node.ToF)

# Configure the ToF node
tofConfig = tof.initialConfig.get()
# tofConfig.depthParams.freqModUsed = dai.RawToFConfig.DepthParams.TypeFMod.MIN
tofConfig.depthParams.freqModUsed = dai.RawToFConfig.DepthParams.TypeFMod.MAX
tofConfig.depthParams.avgPhaseShuffle = False
tofConfig.depthParams.minimumAmplitude = 3.0
tof.initialConfig.set(tofConfig)
# Link the ToF sensor to the ToF node
cam_a.raw.link(tof.input)

Expand Down
32 changes: 4 additions & 28 deletions utilities/cam_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
xout_raw = {}
xout_tof_amp = {}
streams = []
tofConfig = {}
yolo_passthrough_q_name = None
for c in cam_list:
print("CAM: ", c)
Expand All @@ -303,21 +302,14 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
cam[c].raw.link(tof[c].input)
tof[c].depth.link(xout[c].input)
xinTofConfig.out.link(tof[c].inputConfig)
tofConfig = tof[c].initialConfig.get()
tofConfig.depthParams.freqModUsed = dai.RawToFConfig.DepthParams.TypeFMod.MIN
tofConfig.depthParams.avgPhaseShuffle = False
tofConfig.depthParams.minimumAmplitude = 3.0
tof[c].initialConfig.set(tofConfig)

if args.tof_median == 0:
tofConfig.depthParams.median = dai.MedianFilter.MEDIAN_OFF
tof[c].initialConfig.setMedianFilter(dai.MedianFilter.MEDIAN_OFF)
elif args.tof_median == 3:
tofConfig.depthParams.median = dai.MedianFilter.KERNEL_3x3
tof[c].initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_3x3)
elif args.tof_median == 5:
tofConfig.depthParams.median = dai.MedianFilter.KERNEL_5x5
tof[c].initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_5x5)
elif args.tof_median == 7:
tofConfig.depthParams.median = dai.MedianFilter.KERNEL_7x7
tof[c].initialConfig.set(tofConfig)
tof[c].initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_7x7)
if args.tof_amplitude:
amp_name = 'tof_amplitude_' + c
xout_tof_amp[c] = pipeline.create(dai.node.XLinkOut)
Expand Down Expand Up @@ -661,16 +653,6 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
elif key == ord('c'):
capture_list = streams.copy()
capture_time = time.strftime('%Y%m%d_%H%M%S')
elif key == ord('g') and tof:
f_mod = dai.RawToFConfig.DepthParams.TypeFMod.MAX if tofConfig.depthParams.freqModUsed == dai.RawToFConfig.DepthParams.TypeFMod.MIN else dai.RawToFConfig.DepthParams.TypeFMod.MIN
print("ToF toggling f_mod value to:", f_mod)
tofConfig.depthParams.freqModUsed = f_mod
tofCfgQueue.send(tofConfig)
elif key == ord('h') and tof:
tofConfig.depthParams.avgPhaseShuffle = not tofConfig.depthParams.avgPhaseShuffle
print("ToF toggling avgPhaseShuffle value to:",
tofConfig.depthParams.avgPhaseShuffle)
tofCfgQueue.send(tofConfig)
elif key == ord('t'):
print("Autofocus trigger (and disable continuous)")
ctrl = dai.CameraControl()
Expand Down Expand Up @@ -840,12 +822,6 @@ def socket_to_socket_opt(socket: dai.CameraBoardSocket) -> str:
chroma_denoise = clamp(chroma_denoise + change, 0, 4)
print("Chroma denoise:", chroma_denoise)
ctrl.setChromaDenoise(chroma_denoise)
elif control == 'tof_amplitude_min' and tof:
amp_min = clamp(
tofConfig.depthParams.minimumAmplitude + change, 0, 50)
print("Setting min amplitude(confidence) to:", amp_min)
tofConfig.depthParams.minimumAmplitude = amp_min
tofCfgQueue.send(tofConfig)
controlQueue.send(ctrl)

print()
5 changes: 0 additions & 5 deletions utilities/stress_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,6 @@ def build_pipeline(device: dai.Device, args) -> Tuple[dai.Pipeline, List[Tuple[s
tof_xout = pipeline.createXLinkOut()
tof_xout.setStreamName("tof")
tof.depth.link(tof_xout.input)
tofConfig = tof.initialConfig.get()
tofConfig.depthParams.freqModUsed = dai.RawToFConfig.DepthParams.TypeFMod.MIN
tofConfig.depthParams.avgPhaseShuffle = False
tofConfig.depthParams.minimumAmplitude = 3.0
tof.initialConfig.set(tofConfig)
xlink_outs.append(("tof", 4))
continue # No video encoder and edge detector for TOF
else:
Expand Down