How to open tkinter GUI window while opencv webcam is running? - python

We are now working on a thesis based on drowsiness detection within a car. Our code is on a while loop and every time it detects up to 5 or more seconds to be driver is drowsy, the GUI must show up to alert the user that the car is slowly breaking. My problem is while the opencv webcam is runnning (for the drowsiness detection), the tkinter GUI won't show up. Is there any way to like overlap the tkinter window from the webcam frame running in the background?

Related

How to sync audio and video using python

I am making a screen recorder which captures the screen and simultaneously also records the audio from microphone(input) with the help of a python script.
I am using Pillow and opencv library to record screen and using pyaudio library to record audio.
I have created a Gui using tkinter for this screen recorder(shown in image below).
So to start screen and audio recording i used buttons to start and stop different functions of scripts.
Now the problem is that duration of video file(screen recording) and the audio file(using pyaudio) is different.
ex. if user click on screen rec button and after 20-50 sec later click on voice rec button or vice-verse.
The time duration of both the file is different and can't be merge the audio and video file properly.
How can I overcome this situation?

Tkinter is preventing the video from playing

I am new to Python and I am stuck with Tkinter. I have a video running in the background, and I need a label to pop up which contains dynamically changing content. I tried it with tkinter and EasyGUI. The contents are getting printed, but it causes my video to pause. I had to close the pop-up each time, for the video to keep running. I guess the tkinter thread is blocking the video playing thread.

how to Embed video into tkinter window in raspberry pi?

I want to make Queue Management application using Raspberry pi. I want to design my window using tkinter. On that window I want some portion will show the token no and counter no and other portion will show videos. How could i embed video on my window. Other functions I could manage easily but no idea about video. Please help me how could i embed video in my window.

tkinter - full screen window on second display

I coded a simple tkinter GUI for my 3D printer. It is a fullscreen display app that cycles through images.
For each new layer, the app updates the img= parameter for a label widget
In between layers it displays a black image as a safety precaution.
Currently, the GUI runs on top of a command-line interface. As a result, I can't see the progress of the build (e.g. current layer/total layers, build time elapsed, estimated build time completion).
I'd like the app to start on the secondary monitor in fullscreen mode.
So far I've found that even if the correct XY position for the secondary monitor is specified, the --fullscreen attribute will default to the main screen. I have not been able to identify a programmatic workaround.
I can manually hack it by using the control panel to switch the secondary and primary monitors, opening the app in fullscreen, then switching the primary monitors back. But this is painful, especially in a debug scenario where the app is potentially restarted many times.

Changing the colour of a pushbutton using python/raspberry pi

I'm working on a project for work which is essentially a remote monitor that looks at the status of drawbridges. I have a GUI set up that i designed with PyQtDesigner with 8 buttons that are currently coloured red and want them to go green when drawbridges come down. I'm using the GPIO on a raspberry pi to get a signal from the drawbridges but cant get the buttons to change to green.
self.pushButton_7.setStyleSheet("background-color: red")
that's how the buttons are coloured initially but unsure how to change them to green with an input from the raspberry pi, any pointers will be super helpful!
(totally new to pi's and python!)

Categories