有關robomaster開啟鏡頭用opencv部分請參閱:
- import cv2
- from robomaster import robot
- ep_robot = robot.Robot()
- ep_robot.initialize(conn_type="sta")
- ep_camera = ep_robot.camera
- ep_camera.start_video_stream(display=False)
- while True:
- img = ep_camera.read_cv2_image()
- cv2.imshow("Robot", img)
- if cv2.waitKey(1)>0: break
- cv2.destroyAllWindows()
- ep_camera.stop_video_stream()
- ep_robot.close()
沒有留言:
張貼留言