Ask Your Question

zh's profile - activity

2018-07-24 09:04:31 -0600 marked best answer Can't get the resolution I want with opencv
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
cap.set(3,1920)
cap.set(4,1080)

while(1):
    _,frame = cap.read()
    cv2.imshow("capture", frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        cv2.imwrite("save.jpg", frame)
        break
cap.release()
cv2.destroyAllWindows()

When I set the resolution to 19201080, I get the save.jpg with 19201080. But I get save .jpg with 1280720 when I set the resolution to 12801024. Is it because the videocapture device just support some fixed resolution or the opencv?

2018-07-24 04:25:52 -0600 commented question Can't get the resolution I want with opencv

Thanks for your reply. Now I am quite sure it's the camera caused it. Because I changed another capture device and coul

2018-07-22 23:11:04 -0600 asked a question Can't get the resolution I want with opencv

Can't get the resolution I want with opencv import cv2 import numpy as np cap = cv2.VideoCapture(0) cap.set(3,1920) cap.