Seems like the other view is available if you set the correct frame size (reference post).
Here is how you can do it (note that the 2nd view is available below the 1st one).
import argparse
import cv2 as cv
def get_args():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--cam", type=int, default=0, help="camera index")
args = parser.parse_args()
return args
def play_video(idx):
cap = cv.VideoCapture(idx)
width = cap.get(cv.CAP_PROP_FRAME_WIDTH)
height = cap.get(cv.CAP_PROP_FRAME_HEIGHT)
print(f"default size: {width} x {height}")
cap.set(cv.CAP_PROP_FRAME_WIDTH, width)
cap.set(cv.CAP_PROP_FRAME_HEIGHT, height*2)
if not cap.isOpened():
print("Cannot open camera")
exit()
print(f"Showing camera {idx} with backend {cap.getBackendName()}")
cv.namedWindow("Vive Pro Front cameras: Left=Bottom, Right=Top")
while True:
# Capture frame-by-frame
ret, frame = cap.read()
# if frame is read correctly ret is True
if not ret:
print("Can't receive frame (stream end?). Exiting ...")
break
# Our operations on the frame come here
# Display the resulting frame
cv.imshow("Vive Pro Front cameras: Left=Bottom, Right=Top", frame)
k = cv.waitKey(1)
if k == ord('q') or k == 27:
break
# When everything done, release the capture
cap.release()
cv.destroyAllWindows()
if __name__=="__main__":
args = get_args()
play_video(args.cam)