herrDeng網內搜尋

自訂搜尋

Ads

2021年12月2日 星期四

Robomaster-SDK小車行走python程式與openCV傳影像

 
有關robomaster開啟鏡頭用opencv部分請參閱:
  1. import cv2
  2. from robomaster import robot
  3.  
  4. ep_robot = robot.Robot()
  5. ep_robot.initialize(conn_type="sta")
  6.  
  7. ep_camera = ep_robot.camera
  8.  
  9. ep_camera.start_video_stream(display=False)
  10. while True:
  11. img = ep_camera.read_cv2_image()
  12. cv2.imshow("Robot", img)
  13. if cv2.waitKey(1)>0: break
  14. cv2.destroyAllWindows()
  15. ep_camera.stop_video_stream()
  16.  
  17. ep_robot.close()

沒有留言:

Related Posts Plugin for WordPress, Blogger...

熱門文章