- How to check if an opencv window is closed
- cvNamedWindow("main", 1);
- while(!cvWindowIsClosed("main"))
- {
- cvShowImage("main", myImage);
- }
- char exit_key_press = 0;
- while (exit_key_press != 'q') // or key != ESC
- {
- // retrieve frame
- // display frame
- exit_key_press = cvWaitKey(10);
- }