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] cm5 picamera2 bug with optimal alignment #1182

Open
Pepslee opened this issue Dec 20, 2024 · 1 comment
Open

[BUG] cm5 picamera2 bug with optimal alignment #1182

Pepslee opened this issue Dec 20, 2024 · 1 comment

Comments

@Pepslee
Copy link

Pepslee commented Dec 20, 2024

Please only report one bug per issue!

Describe the bug

from picamera2 import Picamera2
picam2 = Picamera2()


video_config = picam2.create_video_configuration(
    main={"format": "YUV420", "size": (1920, 1080)},
    lores={"format": "YUV420", "size": (704, 576)},
)
picam2.configure(video_config)
picam2.start()
array = picam2.capture_array(name="lores", wait=True)
print(array.shape)

image has shape (864, 768)
where 864 is height (576 *2/3) and 768 is width (704 + 64 padded)

704 is optimal for alignment of 64 (704/64 = 11)

so why picamera2 pads 704 with additional 64 ?

To Reproduce
Reproducible on cm5 (picamera 0.3.23), there is no such problem on cm4 (picamera0.3.9)

Expected behaviour
Expected behavior is to get the same size of the array that was set in config if the size has optimal alignment

Console Output, Screenshots
If applicable, any console output or screenshots that show the problem and associated error messages.

Hardware :
cm5, bookworm, picamera2 0.3.23, camera - IMX477 with custom lens (not raspberry high qoality camera)

@davidplowman
Copy link
Collaborator

Hi, I think I answered this on the forum. It's not Picamera2 that's adding extra padding, it's just believing what the kernel driver is telling it. As I said previously, it may be a documentation bug so I'll look into that.

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