I am trying to reduce the frame/window size of my video capture to 320x180
but I can't seem to do it. I am using a Windows Kinect for Xbox One and its connected to my pc using an adapter.
I have tried setting the cv2.CAP_PROP_FRAME_WIDTH
to 320 and cv2.CAP_PROP_FRAME_HEIGHT
to 180 but once I try and get the values it returns 1920 and 1080. I have also tried installing and reinstalling the Kinect SDK and drivers.
import cv2
import numpy as np
vid = cv2.VideoCapture(0)
vid.set(cv2.CAP_PROP_FRAME_WIDTH, 320)
vid.set(cv2.CAP_PROP_FRAME_HEIGHT, 180)
vid.set(cv2.CAP_PROP_FPS, 25)
print(vid.get(cv2.CAP_PROP_FPS))
print(vid.get(cv2.CAP_PROP_FRAME_WIDTH))
while True:
ret, frame = vid.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame', gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
vid.release()
cv2.destroyAllWindows()
I would like help in knowing where the problem stems from and hopefully get a fix.