Skip to content

Commit

Permalink
Starting from version 2.9, depthai supports scripting node -> README …
Browse files Browse the repository at this point in the history
…and requirements.txt updated.

Add 's' key in 3d visualization to stop rotating or oscillating.
  • Loading branch information
geaxgx committed Aug 13, 2021
1 parent fd62f50 commit b9e92c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
6 changes: 2 additions & 4 deletions BlazeposeDepthaiEdge.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ def __init__(self, input_src="rgb",

if input_src == None or input_src == "rgb" or input_src == "rgb_laconic":
self.input_type = "rgb" # OAK* internal color camera
self.laconic = input_src == "rgb_laconic" # Camera frames are not sent to the host

self.laconic = input_src == "rgb_laconic" # Camera frames are not sent to the host
if xyz:
# Check if the device supports stereo
cameras = self.device.getConnectedCameras()
Expand All @@ -116,8 +115,7 @@ def __init__(self, input_src="rgb",
else:
print("Warning: depth unavailable on this device, 'xyz' argument is ignored")

if internal_fps is None:

if internal_fps is None:
if "full" in str(self.lm_model):
self.internal_fps = 18 if self.xyz else 20
elif "heavy" in str(lm_model):
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ If using a 3D visualization mode ("-3" or "--show_3d"):
|-|-|
|o|Oscillating (rotating back and forth) of the view|
|r|Continuous rotating of the view|
|s|Stop oscillating or rotating|
|*Up*|Increasing rotating or oscillating speed|
|*Down*|Decreasing rotating or oscillating speed|
|*Right* or *Left*|Change the point of view to a predefined position|
Expand Down
4 changes: 4 additions & 0 deletions o3d_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(self, bg_color=[0,0,0], zoom=1, segment_radius=1):
# Defining callbacks - Key codes: https://www.glfw.org/docs/latest/group__keys.html
self.vis.register_key_callback(ord("R"), self.start_rotating)
self.vis.register_key_callback(ord("O"), self.start_oscillating)
self.vis.register_key_callback(ord("S"), self.stop_moving)
self.vis.register_key_callback(262, self.turn_view_right) # Right arrow
self.vis.register_key_callback(263, self.turn_view_left) # Left arrow
self.vis.register_key_callback(265, self.incr_rot_speed) # Up arrow
Expand Down Expand Up @@ -218,6 +219,9 @@ def start_rotating(self, vis):
def start_oscillating(self, vis):
self.move = "oscillate"
self.angle = 0
# Callback
def stop_moving(self, vis):
self.move = None

def try_move(self):
if self.move == "rotate":
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
opencv-python >= 4.5.1.48
open3d
depthai >= 2.9

0 comments on commit b9e92c1

Please sign in to comment.