07-25-2020, 04:46 PM
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!")
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!")