Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5822

Camera board • Re: Picamera2, does the size stream parameter crop the image ?

$
0
0
That sounds right. The first thing you see is it selecting the sensor mode given the output image size that you have requested. In this case it reckons 2304x1296 is the best match for 1920x640. (You can override that decision if you want, of course.)

Thereafter the camera image is cropped so that the aspect ratio matches what you requested. It chooses the biggest crop from the sensor that it can, so in this case you should get the full width, but lose the top and bottom.

Finally it will rescale that to the output size that you asked for.

In the Python world you can look at the scaler crop control once the camera has been configured (picam2.camera_controls['ScalerCrop']). This will tell you the default crop that it is using, which is the one described above that has the correct aspect ratio. It will also tell you the maximum allowable scaler crop, which is everything that the sensor delivers. You could set this and it would give you the largest field of view, but with a squished image if the aspect ratios did not match.

Statistics: Posted by therealdavidp — Tue Mar 26, 2024 2:00 pm



Viewing all articles
Browse latest Browse all 5822

Trending Articles