Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
openCV + GUI
#1
I am completely new to Python.
Here is the task:
I need openCV window with video stream; on right click in window area I need a small GUI panel to pop-up with few simple controls; this panel must not block video stream and controls should communicate in real time with openCV window (f.e. scroller adjusting video brightness). When 'OK' button clicked on GUI panel, it should disappear and only openCV window stays.
I am using Tkinter and Python 2.7 on Windows 7
I tried the approach of showing video in tkinter window, controls in toplevel window and use 'after' function, but it is not acceptable - performance dropped and communication between two windows got really messy.
So it must be pure openCV window for image and tkinter GUI for controls.
I tried to do it in threads, but also failed because tkinter is not thread-safe and must run in the main thread only, while for my task the main app is openCV and GUI is called only for a short time.
I am planning to use multiprocessing - run openCV and tkinter in different processes, main tkinter window hidden and waiting for event raised by main process (openCV), when called, pass controls data to openCV through the pipe. Will this approach work, or are there any better (and not overcomplicated) options?
I use python because I am planning to make this application run on Raspberry as well; my plan B if python approach fails, would be to make it in C++.
Reply


Messages In This Thread
openCV + GUI - by Konstantin - Oct-23-2017, 05:14 PM
RE: openCV + GUI - by Larz60+ - Oct-23-2017, 05:24 PM
RE: openCV + GUI - by Konstantin - Oct-23-2017, 05:30 PM
RE: openCV + GUI - by Larz60+ - Oct-23-2017, 09:08 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020