How to change the default sensor mode that gets selected by the video configuration? #756
-
I am having issues setting up my Module 3 Camera WIDE to use the full image crop. I can run .sensor_modes to see the available modes, but I can't figure out how to select one. I checked the documentation on configuring the camera, but can't really see a way to select a preconfigured mode. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
Hi, you should be able to pass one of those modes directly, for example
or alternatively just list the format and size that you have identified:
|
Beta Was this translation helpful? Give feedback.
-
Could you just confirm your Picamera2 version? There was a bug exactly like this that was fixed a little while ago. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Could you include the exact and most minimal script - presumably just a handful of lines - that produce this error? Then it's easy for me to try it and know that I'm looking at the right problem. Thanks. |
Beta Was this translation helpful? Give feedback.
-
The trouble is that when you ask for a particular output image size, libcamera has to guess which of the sensor modes to use. Within libcamera all it sees are the sensor formats and resolutions, but not the "crop" (which affects the field of view). So from its point of view, 1536x864 is the best match for 800x480. Unfortunately, this is a "cropped" mode. But as you've seen we can override the behaviour by specifying directly what raw stream size we want. Now it will select the sensor resolution that most closely matches the raw stream size, irrespective of how much scaling happens to produce the final output images. In our case, specifying a raw stream size of 2304x1296 is effectively forcing the use of that sensor mode, which we know to be uncropped (full FoV). Hope that makes sense! |
Beta Was this translation helpful? Give feedback.
The trouble is that when you ask for a particular output image size, libcamera has to guess which of the sensor modes to use. Within libcamera all it sees are the sensor formats and resolutions, but not the "crop" (which affects the field of view). So from its point of view, 1536x864 is the best match for 800x480. Unfortunately, this is a "cropped" mode.
But as you've seen we can override the behaviour by specifying directly what raw stream size we want. Now it will select the sensor resolution that most closely matches the raw stream size, irrespective of how much scaling happens to produce the final output images. In our case, specifying a raw stream size of 2304x1296 is effectively for…