Reputation: 845
I have recently started using OpenCV 2.4.10 with VS2013. My program involves displaying a few images using imshow()
along with outputting some values in the console window using cout
. I have used getchar()
before returning from the main function. This allows me to see the program output before the program exits.
Once the program exits, all the windows are closed. Is it possible to keep the windows open even after the program exits?
I found a related post but the answers are for the debugging phase and not after the program exits. As suggested by other answers to that post, my Properties>Configuration Properties> Linker> System>SubSystem is already set to console. Another post suggests using ctrl+F5
instead of F5
. That keeps the program output window open but the windows showing images close down.
I looked through the OpenCV documentation on User Interface related functions but couldn't find my answer as well.
Upvotes: 1
Views: 609
Reputation: 41775
I don't think you can. After the program ends, it will close also the windows of your images.
If you need to view the images after program end, you could simply save (using imwrite
) the images and see them in your preferred image viewer.
If you need to check pixel values, type of matrix and other useful stuff, you should install Image Watch extension in Visual Studio. Note that also this will close when program ends.
Upvotes: 1