OpenCV 3.4.2 VideoCapture letter boxed [x-post so]

asked 2018-07-24 10:53:31 -0600

I'm using opencv on Windows. When I was using 3.4.1 I was able to capture full HD images and half HD images. After updating to 3.4.2 the image is now letter boxed. The resolution is correct, but there are black bars where there used to be image data. How can I get rid of this letter box?

Here is my catpure code:

import numpy as np
import cv2

scaleFactor = 0.5
cap = cv2.VideoCapture(2)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, int(1920*scaleFactor))
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, int(1080*scaleFactor))

print cap.get(cv2.CAP_PROP_FRAME_WIDTH)
print cap.get(cv2.CAP_PROP_FRAME_HEIGHT)

while(True):
    # Capture frame-by-frame
    ret, frame = cap.read()
    if not ret:
        continue

Letter boxed frame

edit retag flag offensive close merge delete