Help with correctly configuring the camera #567
Replies: 3 comments 3 replies
-
Setting an additional 'raw' configuration in the mode you want to force the system to use is one way to do it. eg something like or more generally to pick up the available sensor modes with picam2.sensor_modes and then apply the appropriate one with raw=picam2.sensor_modes[x] as per Section 4.2.2 of the manual. |
Beta Was this translation helpful? Give feedback.
-
Yea, I see the same. Hopefully someone more knowledgeable will advise how-to correctly, but a workaround that allows setting some of the basic configurations without knowing the specific sensor sizes is as below.
HTH Sandy |
Beta Was this translation helpful? Give feedback.
-
That all sounds reasonable to me - specifying the raw stream resolution is the way you force the camera mode that you want. The notion of a "full resolution mode" and a "2x2 binned mode" is generally true - except when it isn't (Global Shutter cam, for example)! In the end, the only way to be sure you have the best mode for any particular application, is to look through them and decide (or program your application to decide) for itself. For this reason there's the
That gives you a list of all the camera modes that truly exist, as well as information about them, such as resolution, max framerate, field of view, so in theory you can make all those trade-offs for yourself. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
If I use the following configuration with a camera 3 wide
picam2.configure(picam2.create_video_configuration(main={"size": (1440, 1440), "format": "RGB888" },
lores={"size": (440, 440), "format": "YUV420"}, encode = "lores"))
picam2.set_controls ({"ScalerCrop":(1400,450,1800,1800)})
The stream from the lores configuration is as I want it and a captured frame from the main configuration
is also correct but is twice the size that I want and I am having to resize it to 720x720.
If however I use the following instead
picam2.configure(picam2.create_video_configuration(main={"size": (720, 720), "format": "RGB888" },
lores={"size": (440, 440), "format": "YUV420"}, encode = "lores"))
picam2.set_controls ({"ScalerCrop":(1400,450,1800,1800)})
While the sizes are now as I want them the cropped area is not correct.
This would appear to be because of the sensor image format, in the first case it is reporting
Selected sensor format: 2304x1296-SBGGR10_1X10 - Selected unicam format: 2304x1296-pBAA
while in the second case it is reporting
Selected sensor format: 1536x864-SBGGR10_1X10 - Selected unicam format: 1536x864-pBAA
Is there a way I can force it to use the larger sensor format while still setting the size to 720x720
Thanks
Beta Was this translation helpful? Give feedback.
All reactions