sensor crop, frame resolution, packing #585
Replies: 1 comment
-
To answer these kinds of questions, it might be helpful, after configuring Picamera2 (with For the example above, where the main stream is 1984x1520 in size, For YUV420 output you can't have an image that is 1487 pixels high, but if you ask for a 1984x1488 output the scaler crop reports Generally there shouldn't be too much reason to align configurations unless you have downstream software that can't deal with arrays that are not fully contiguous (i.e. may have padding at the ends of rows), though others may have more practical experience of this. |
Beta Was this translation helpful? Give feedback.
-
I have a question about the relationship between sensor crop, frame resolution, and packing/alignment.
My camera is a RP HQ, which offers four modes. The mode I want is
picam2.sensor_modes[2]
, for which the relevant entries are:The relevant part of my config is:
Although I do not use raw directly, I specify the raw size to ensure that main contains the full uncropped 4056x3040 field of view (FOV).
The motivation for my question is that I'd like to have an efficient packing/alignment for the data. Appendix A of the "Picamera2 Library" says that YUV420 is best aligned on 64-pixel boundaries. Indeed,
picam2.align_configuration(config)
suggests 1984 x 1520 pixels for main, corresponding toMy issue: this has the wrong aspect ratio; about 1984 x 1487 pixels would be correct.
My question: how does libcamera/picamera2 cope with this? Does it:
To pose the question differently, suppose that I set
which aligns main on 64-pixel boundaries and is very close to the sensor's aspect ratio (almost exactly 2048x1535). Is the full FOV mapped onto the 2048x1536 array? Or is the final row of the image set to nonsense values?
I'm not sure if this matters for photography, but it is important for image analysis.
Cheers,
Bruce
Beta Was this translation helpful? Give feedback.
All reactions