a-shell
a-shell copied to clipboard
opencv low resolution with camera
Thank you so much for providing opencv package :heart:. This means a lot to me as I have been requesting it for almost 2 years.
When I started to use it, I am glad to see that it can actually access the front and back camera of my iOS device (after providing permission of course).
import cv2
cap = cv2.VideoCapture(0) # 0 and 1 for back and front camera
ret, frame = cap.read()
cv2.imwrite("test.jpg", frame) # save the frame from camera to file
cap.release()
However, the captured image only has 480x360 resolution, and there is apparently no way to change it. I have tried the following command with no success
cap.set(cv.CV_CAP_PROP_FRAME_WIDTH, 1920)
cap.set(cv.CV_CAP_PROP_FRAME_HEIGHT, 1080)
This could be an issue of opencv package itself, as I found the following similar issues. It's appreciated if someone can take a look on this.