我想同时看到两个相机的画面
下面是程式码,但是我不确定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