Skip to content

Commit

Permalink
Fix typos in python samples (#627)
Browse files Browse the repository at this point in the history
* Fix streaming python samples

* Fix python birds eye view display units

---------

Co-authored-by: Matthew Rousseau <matthew.rousseau@stereolabs.com>
  • Loading branch information
mattrouss and Matthew Rousseau authored Mar 22, 2024
1 parent 82b8f34 commit b38a7ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion camera streaming/receiver/python/streaming_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def on_mouse(event,x,y,flags,param):
def main():
init_parameters = sl.InitParameters()
init_parameters.depth_mode = sl.DEPTH_MODE.NONE
init_parameters.sdk_verbose = True
init_parameters.sdk_verbose = 1
init_parameters.set_from_stream(opt.ip_address.split(':')[0],int(opt.ip_address.split(':')[1]))
cam = sl.Camera()
status = cam.open(init_parameters)
Expand Down
2 changes: 1 addition & 1 deletion camera streaming/sender/python/streaming_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main():
init = sl.InitParameters()
init.camera_resolution = sl.RESOLUTION.AUTO
init.depth_mode = sl.DEPTH_MODE.NONE
init.sdk_verbose = True
init.sdk_verbose = 1
parse_args(init)
cam = sl.Camera()
status = cam.open(init)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def render_2D(self, left_display, img_scale, objects, render_mask, isTrackingON)
cv2.putText(left_display, "ID " + str(obj.id), (int(position_image[0]) - 20, int(position_image[1]) - 30),
cv2.FONT_HERSHEY_COMPLEX_SMALL, 0.5, (255, 255, 255, 255), 1)
if math.isfinite(obj.position[2]):
text = "{:.1f}M".format(abs(obj.position[2] / 1000.0))
text = "{:.1f}M".format(abs(obj.position[2]))
cv2.putText(left_display, text, (int(position_image[0]) - 20, int(position_image[1])),
cv2.FONT_HERSHEY_COMPLEX_SMALL, 0.5, (255, 255, 255, 255), 1)
cv2.addWeighted(left_display, 0.7, overlay, 0.3, 0.0, left_display)
Expand Down

0 comments on commit b38a7ea

Please sign in to comment.