stereolabs / zed-opencv

ZED SDK interface sample for OpenCV
https://www.stereolabs.com/docs/opencv/
MIT License
137 stars 79 forks source link

ZED Camera: Setting Resolution via Python 2.7 and OpenCV #9

Closed atomoclast closed 2 years ago

atomoclast commented 8 years ago

Hello,

I was wondering if there was a way to directly adjust the ZED camera's resolution? I know we can do it through Cheese, so it should be possible to do it with other code vs only using the ZED SDK.

I have tried code such as:

cap = cv2.VideoCapture(0)

cap.set(3, 4416)
cap.set(4, 1242)

as well as code such as:

cap = cv2.VideoCapture(0)

cap.set(3, 2208)
cap.set(4, 1242)

The default resolution is still just 640x480 for each frame (or 1280x480 combined).

Has any one had to do this or had any success in changing the resolution via other means by using the ZED as just a USB camera?

Thanks in advance,

Andrew

Bootstrap360 commented 7 years ago

Have you found any solutions?

Bardo91 commented 7 years ago

I am using it in the c++ code and I am able to configure its resolution using:

     zedCamera.set(CV_CAP_PROP_FRAME_WIDTH, width);
     zedCamera.set(CV_CAP_PROP_FRAME_HEIGHT, height);

I assume that it should be also possible from the python code,

Bootstrap360 commented 7 years ago

I got it working in Python.

I forgot that the ZED camera is twice as wide as the typical 16:9 aspect ratio.

cap = cv2.VideoCapture(0)

cap.set(3, 2560)
cap.set(4, 720)
Bardo91 commented 7 years ago

So... is it closed the issue?

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days