0
我通過ssh連接到遠程系統,並嘗試使用Python中的OpenCV VideoCapture讀取幀。Python OpenCV:Python 2.7與Python 3.5之間的VideoCapture差異
import cv2
cap = cv2.VideoCapture(0)
Python2.7:
print cap.isOpened() # prints True, further read() calls also return True
Python3.5:
print (cap.isOpened()) # prints False, and so are cap.open(), and of course cap.read().
什麼會導致這樣的行爲使用Python 2.7,當使用Python 3.5時相同的代碼成功與失敗?
謝謝!
每個Python版本都有自己的openCV二進制副本,也許這兩個版本是用不同的選項構建的? –