Multiple imshow windows without needing waitkey in same function [closed]
Hi,
I'm looking to have a GUI that has multiple areas to show images. This is mainly for debugging so that I can show the image at various stages of the algorithm - maybe something like imshow(window_id, image_name)
. But I also don't want to have to waitkey
all the time - the display window should just always be running and displaying images as and when some imshow
is called.
What's the best way to implement this? Is it using a qt GUI?
Thank you
insn't it just a logic problem ? waitKey() is something "global", you probably need only 1 call per time-frame (and probably not per image, or per window. e.g. most progs should run fine with a single waitKey() at the end of the main loop)
hmm, all right apart from the waitkey bit - what's the best way to have a GUI that has say 4 windows to display images?
i'm the wrong person to ask ;)
(after some years with this, i'm like totally biased against any kind of additional gui. ornament is crime, simply. you're wasting time on buttons and fileboxes, that should go into improving your algo. noone but you also will likely see your effort. cv is all about retrieving numbers. optimize for that ;)
....wow :)
sidenote: occasionally i'm actually selling something. but lately that usually has to run on some webserver
(so: don't bind to any gui, before you know, where this is going !)
I will also point out that imshow is not a particularly efficient display method. If you really need to display things and run fast, use a different method.
like what?
Whatever the appropriate GUI framework is. I don't actually ever use one, for pretty much the same reasons as berak. You can get the data pointer from the cv::Mat and pass it to the framework usually.
@berak@Tetragramm what if you made it general enough - it might take a few days to create but then you can use it for years
Make what general enough? OpenCV allows you to access the data, which means you can interface with just about every GUI. I mean, it's not really part of computer vision to figure out how to display things on the screen. I'm happy to leave that to JavaFX or QT or WinForms, whatever.
If you do write a more efficient, multi-platform display thing, feel free to commit it.
And just like berak said, after the last of your imshow calls, put waitKey(1) and be done with it.