Hi, now i’m use raspberry pi 4 and ELP Dual Lens Camera(1.3MP 960P USB2.0 dual lens usb camera module Synchronization camera for 3D depth detection [ELP-960P2CAM-V90] - $0.00 : Surveillance Equipment,CCTV Systems,USB Camera Module Supplier, Best USB Cameras Module,Network IP Cameras,Analog CCTV Cameras,IP Network Video Recorders ,Digital Video Recorders,IP Network Camera Systems,Security Camera Systems,Mobile DVR Systems ,Security System Accessories,Color LCD/LED Monitor/Car Video,Wireless Tranmission Module ,Digital camera lens for building, city,airport,police,bank,shop,home and office etc.) for build depth map.
i’m working with a stereo camera n capture frames with opencv.
when i capture from camera its the results.
How can i splitting camera frame into left and right?
import cv2
CamL = cv2.VideoCapture(2 + cv2.CAP_DSHOW)
CamL.set(cv2.CAP_PROP_FRAME_WIDTH, 400)
CamL.set(cv2.CAP_PROP_FRAME_HEIGHT, 300)
CamR = cv2.VideoCapture(3 + cv2.CAP_DSHOW)
CamR.set(cv2.CAP_PROP_FRAME_WIDTH, 400)
CamR.set(cv2.CAP_PROP_FRAME_HEIGHT, 300)
while True:
__, imgL = CamL.read()
__, imgR = CamR.read()
cv2.imshow('L', imgL)
cv2.imshow('R', imgR)
k = cv2.waitKey(30) & 0xff
if k == 27:
break
CamL.release()
CamR.release()
cv2.destroyALLWindows()
i’m trying to do this script on my pi but error.
this is the error
Traceback (most recent call last):
File "/home/pi/Desktop/capture/sklearn.py", line 14 in <module>
cv2.imshow('L' imgL)
cv2.error : OpenCV(4.5.1) /home/pi/opencv/opencv-4.5.1/modules/highgui/src/window.cpp:384: error: (-215:Assertion failed) size.width>0 && size.height>0 function 'imshow'
what’s the problem?