1

I thought imshow not supposed to show image if the window don't exist but apparently it is. I don't understand if it is a bug of i did not understand correctly.

I am tring to not open a new window if the user close it. I thought I will open the window at init and at other part I just use imshow and that way if the user close the window it won't appear again. but because imshow show the image this is not working. how can i achieve this goal?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
shanif
  • 464
  • 1
  • 4
  • 12
  • This concerns your OS environment. Try to handle the "close window event". E.g. use [cvGetWindowHandle](http://stackoverflow.com/questions/9321389/how-to-check-if-an-opencv-window-is-closed). – LovaBill Apr 08 '13 at 11:42

1 Answers1

0

When called, cv::imshow() will display the image on a window. If that window doesn't exist at the time of the call, one will be created.

If you don't want to display a window, don't call cv::imshow().

karlphillip
  • 92,053
  • 36
  • 243
  • 426