Open EnziinSystem opened 4 months ago
Hi, thanks for the report. Could we perhaps start with a simpler example, maybe examples/preview.py
- does that work?
I'm also a bit suspicious that maybe you've installed a version of OpenCV with a different version of PyQt from the one in Picamera2. Can you say how you installed OpenCV? I would strongly recommend the version from apt.
Hi, thanks for the report. Could we perhaps start with a simpler example, maybe
examples/preview.py
- does that work?I'm also a bit suspicious that maybe you've installed a version of OpenCV with a different version of PyQt from the one in Picamera2. Can you say how you installed OpenCV? I would strongly recommend the version from apt.
Version OpenCV
$ python
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print("OpenCV version:", cv2.__version__)
OpenCV version: 4.9.0
>>>
I also know the problem is that the latest versions of OpenCV-python do not include the library for Wayland.
This isn't a Picam2 bug, I'm just looking for a solution for Wayland on the Pi-5.
Thanks for the update. So you're right, this might be related to Wayland, or possibly Qt versions. Nonetheless, I'd like to start with perhaps the simplest example we can. Are you able to say what that very simple example does?
It is the case that if you download a vanilla Raspberry Pi OS image and change nothing at all (other than letting it perform its updates), then examples/preview.py
works, whether running Wayland or X11. Picamera2 doesn't talk to Wayland directly, it still (I believe, I might be wrong) uses the X11 protocols and relies on XWayland to handle them. So in this respect, Wayland might not be the issue, or at least, not directly.
But I have seen problems like this when OpenCV wants to use a different version of Qt from the one installed from apt for Picamera2. If you installed OpenCV from somewhere else (did you compile it yourself? did you install it using pip?), then my suggestion would be to uninstall it and go back to the version from apt. It might be worth trying out a fresh installation of Raspberry Pi OS, and verifying that it works as I described.
I have a Pi-5 with the camera v3 and I installed all packages in Readme.
I also know Pi-5 uses Wayland instead of X.
Run an example:
I don't want to go back to using X on the Pi-5 because it will probably break other things.
Any solution for Picam2 on Pi-5 use Wayland with V3 camera module?
Thanks.