Private Island Networks Inc.

How to keep an OpenCV window open after imshow?

share
subscribe to mailing list:

Question / Issue:

Below is my C Code for OpenCV to show a window. How do I keep it open, so I can screen capture it? cv::namedWindow( "img", cv::WINDOW_AUTOSIZE ); cv::imshow( "img", img ); cv::waitKey( 0 ); cv::destroyWindow( "img" );
X-ray Engineering Services

Responses:

Date: Nov. 12, 2019

Author: Mind Chasers

Comment:

Try the solution below and then kill the app when you're ready to close the window (e.g., Ctrl+C) cv::namedWindow( "img", cv::WINDOW_AUTOSIZE ); cv::imshow( "img", img ); cv::waitKey( 0 ); //cv::destroyWindow( "img" ); while(1) { }

Post your answer or comment:

your email address will be kept private
authenticate with a 3rd party for enhanced features, such as image upload
previous month
next month
Su
Mo
Tu
Wd
Th
Fr
Sa
loading