Trying to migrate a python and opencv application from bullseye to bookwork. After installing bookworm, installing opencv, I ran the libcamera and Picamera2 sames and they work, including the opencv face detect examples. I tried my program and the camera was failing. I found by searching the opencv VideoCamera(0) won't work. I switched the desktop to Wayland and it didn't work. I tried the X11 and other pi display option and it didn't work. So I replaced the camera access with a Picamera2 implementation and that worked.
I have Display.py class that displays frames on the screen with cv2.imshow. Display.py runs on another thread. Why? The frames go through processing from the camera and are sent to Display.py and ImageWriter.py (images and videos). Both of these classes run on separate threads. So in Display.py cvs.imshow runs.
The program freezes and I see on the console:ChatGPT shows me:Say it ain't so Joe. Change threading model is too much work right now. It means making the program fit under Qt - so to speak, whereas opencv can just display anywhere. Suggestions besides going back to bullseye for this application?
I have Display.py class that displays frames on the screen with cv2.imshow. Display.py runs on another thread. Why? The frames go through processing from the camera and are sent to Display.py and ImageWriter.py (images and videos). Both of these classes run on separate threads. So in Display.py cvs.imshow runs.
The program freezes and I see on the console:
Code:
QObject::startTimer: Timers cannot be started from another thread
Code:
To fix the crash:Ensure all GUI-related actions occur in the main thread.Use signals and slots for thread-safe communication.Ensure QTimer objects and QObject::startTimer() calls are in the main thread.
Statistics: Posted by bluePiuser — Sat Nov 23, 2024 1:34 am — Replies 0 — Views 32