mycobot_ros/mycobot_ai/ai_mecharm_270/scripts/openVideo.py
2022-07-18 11:37:04 +08:00

8 lines
178 B
Python
Executable file

import cv2 as cv
if __name__ == "__main__":
cap_num = 0
cap = cv.VideoCapture(cap_num)
while cv.waitKey(1)<0:
_, img = cap.read()
cv.imshow("", img)