Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Python在Mac无法访问网络摄像头

#1
Exclamation
I'm trying to control the offline robot using input from the camera. The program works well on my windows system. However, the program is not running on my Mac. It is able to open a video file though

import cv2

cap = cv2.VideoCapture(0)
#cap = cv2.VideoCapture('/Users/riddhamanna/Documents/RoboDK/ymaze.mp4')

while(True):
ret, img = cap.read()
cv2.imshow('frame',img)
if cv2.waitKey(1) & 0xFF == 27:#ord('q'):
break

cap.release()
cv2.destroyAllWindows()
print("Hello World!")


Attached Files Thumbnail(s)



Messages In This Thread
Python在Mac无法访问网络摄像头 - byriddha- 07-25-2020, 04:46 PM



Users browsing this thread:
1 Guest(s)