Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Change in returned dimension of return value of capture_array when going from RPI4->RPI5. #1151

Open
zkelly1 opened this issue Oct 31, 2024 · 1 comment

Comments

@zkelly1
Copy link

zkelly1 commented Oct 31, 2024

Please only report one bug per issue!

Describe the bug
We have noticed that, when going from RPI4->RPI5, the numpy array returned from capture_array has changed shape. Specifically, the width has doubled and the height as remained the same. Originally, this output a junk image. We found if we only take the odd columns, we get the correct image. We assume this is due to a bit related error. Though, both the numpy array and our sensor mode are 8 bit.

To Reproduce

  1. Initialize the camera on RPI5.
  2. Make a capture via capture_array('raw')
  3. Examine the size and compare to the sensor mode (these should be unequal).

Expected behaviour
The camera properly returns the size of image as defined by the sensor mode (480, 640) instead of (480, 1280).

Hardware :
We are using an RPI5 with a Sony IMX 219 camera connected via HDMI.

Additional context
Add any other context about the problem here.

@davidplowman
Copy link
Collaborator

Raw formats are different on Pi 5 compared to all earlier Pis. Definitely worth reading section 4.2.2.3. "Raw streams and the Sensor Configuration" on page 21 of the manual. There's quite a lot about the differences between Pi 4 and Pi 5 there.

As always, if you can supply a specific example, just a few lines of code, where you configure a raw stream and it's not what you expect, that would be helpful. I would start with something like this:

from picamera2 import Picamera2

cam = Picamera2()
config = ...  # however you make your configuration
cam.configure(config)
print(cam.camera_configuration()[raw])  # is this what you expect?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants