I am trying to change the resolution of PS5 camera in OpenCV, Python.
The problem is that PS5 Camera officially isn't supported on PC, and I have to use custom camera drivers from GitHub: https://github.com/Hackinside/PS5_camera_files
Default image resolution by this code is 640x376
self.capture = cv2.VideoCapture(name)
I found out that supported resolutions of this camera are 640x376 and 5148×1088, so I tried to do next:
res = self.capture.set(cv2.CAP_PROP_FRAME_WIDTH, 5148)
res = self.capture.set(cv2.CAP_PROP_FRAME_HEIGHT, 1088)
But in both cases res
is False
, and resolution doesn't change. I can recieve only small resolution frame.
Camera 100% can work in 5148×1088, because if I launch Windows Camera application it shows me high quality images
CodePudding user response:
Okey, the problem was, that I had a piece of code, there I read frame from the capture using loop:
while True:
self.capture.read()
It was in a parallel thread so changing the resolution was in a same time with reading images. It was a reason why change resolution process was always failed.
So the provided code in question should work, if you do it before starting reading images.
CodePudding user response:
The best way is if you have a PC, transfer the photo to the PC and then on the photo view application you can change the size. On Mac, you can go to Preview. Tools>Ajust Size Then change the pixel size. Hope that helped.