I'm trying to capture photos and videos using cv2.VideoCapture and cameras with an aspect ratio of 16:9. All image is returned by OpenCV have black sidebars, cropping the image. In my example, instead of returning an image with 1280 x 720 pixels, it returns a 960 x 720 image. The same thing happens with a C920 webcam (1920 x 1080).
What am I doing wrong?
import cv2
video = cv2.VideoCapture(0)
video.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
video.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
while True:
conected, frame = video.read()
cv2.imshow("Video", frame)
if cv2.waitKey(1) == ord('s'):
video.release()
break
cv2.destroyAllWindows()
Using OpenCV:
Using Windows Camera: