我想同時看到兩個相機的畫面
下面是程式碼,但是我不確定ret是否可以這樣用?
而且執行是會用顯示scn == 3 || scn == 4 in function cv::cvtColor
不知道是哪裡有了問題
import cv2
import numpy as np
captureR = cv2.VideoCapture(1)
captureL = cv2.VideoCapture(2)
while(True):
retR, frameR = captureR.read()
retL, frameL = captureL.read()
grayR = cv2.cvtColor(frameR, cv2.COLOR_BGR2GRAY)
grayL = cv2.cvtColor(frameL, cv2.COLOR_BGR2GRAY)
cv2.imshow('frameR', grayR)
cv2.omshow('frameL', grayL)
if cv2.waitKey(1) == ord('q'):
break